Index: openacs-4/packages/forums/tcl/forums-security-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/forums/tcl/forums-security-procs.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/forums/tcl/forums-security-procs.tcl 29 May 2002 21:40:10 -0000 1.1 +++ openacs-4/packages/forums/tcl/forums-security-procs.tcl 3 Jun 2002 04:39:05 -0000 1.2 @@ -14,105 +14,112 @@ {-user_id ""} {-forum_id:required} } { - # hack - return 1 + return [permission::permission_p -party_id $user_id -object_id $forum_id -privilege forum_read] } ad_proc -public require_read_forum { {-user_id ""} {-forum_id:required} } { - + if {![can_read_forum_p -user_id $user_id -forum_id $forum_id]} { + do_abort + } } ad_proc -public can_read_message_p { {-user_id ""} {-message_id:required} } { - # hack - return 1 + return [permission::permission_p -party_id $user_id -object_id $message_id -privilege forum_read] } ad_proc -public require_read_message { {-user_id ""} {-message_id:required} } { - + if {![can_read_message_p -user_id $user_id -message_id $message_id]} { + do_abort + } } ad_proc -public can_post_forum_p { {-user_id ""} {-forum_id:required} } { - return [permission::permission_p -object_id $forum_id \ - -party_id $user_id \ - -privilege forum_create] + return [permission::permission_p -party_id $user_id -object_id $forum_id -privilege forum_write] } ad_proc -public require_post_forum { {-user_id ""} {-forum_id:required} } { - + if {![can_post_forum_p -user_id $user_id -forum_id $forum_id]} { + do_abort + } } ad_proc -public can_post_message_p { {-user_id ""} {-message_id:required} } { - # hack - return 1 + return [permission::permission_p -party_id $user_id -object_id $message_id -privilege forum_write] } ad_proc -public require_post_message { {-user_id ""} {-message_id:required} } { - + if {![can_post_message_p -user_id $user_id -message_id $message_id]} { + do_abort + } } ad_proc -public can_moderate_forum_p { {-user_id ""} {-forum_id:required} } { - # hack - return 1 + return [permission::permission_p -party_id $user_id -object_id $forum_id -privilege forum_moderate] } ad_proc -public require_moderate_forum { {-user_id ""} {-forum_id:required} } { - + if {![can_moderate_forum_p -user_id $user_id -forum_id $forum_id]} { + do_abort + } } ad_proc -public can_moderate_message_p { {-user_id ""} {-message_id:required} } { - # hack - return 1 + return [permission::permission_p -party_id $user_id -object_id $message_id -privilege forum_moderate] } ad_proc -public require_moderate_message { {-user_id ""} {-message_id:required} } { - + if {![can_moderate_message_p -user_id $user_id -message_id $message_id]} { + do_abort + } } ad_proc -public can_admin_forum_p { {-user_id ""} {-forum_id:required} } { - # hack - return 1 + return [permission::permission_p -party_id $user_id -object_id $forum_id -privilege forum_moderate] } ad_proc -public require_admin_forum { {-user_id ""} {-forum_id:required} } { - + if {![can_admin_forum_p -user_id $user_id -forum_id $forum_id]} { + do_abort + } } + }