Index: openacs-4/packages/acs-tcl/tcl/acs-permissions-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/acs-permissions-procs.tcl,v diff -u -r1.6 -r1.7 --- openacs-4/packages/acs-tcl/tcl/acs-permissions-procs.tcl 15 May 2002 18:47:31 -0000 1.6 +++ openacs-4/packages/acs-tcl/tcl/acs-permissions-procs.tcl 22 Jun 2002 17:07:22 -0000 1.7 @@ -1,60 +1,13 @@ ad_library { + Tcl procs for the acs permissioning system. @author rhs@mit.edu @creation-date 2000-08-17 - @cvs-id $Id$ -} + @version $Id$ -ad_proc -deprecated ad_permission_grant { - user_id - object_id - privilege -} { - Grant a permission - - @author ben@openforce -} { - permission::grant -party_id $user_id -object_id $object_id -privilege $privilege } -ad_proc -deprecated ad_permission_revoke { - user_id - object_id - privilege -} { - Revoke a permission - - @author ben@openforce -} { - permission::revoke -party_id $user_id -object_id $object_id -privilege $privilege -} - -ad_proc -deprecated ad_permission_p { - {-user_id ""} - object_id - privilege -} { - return [permission::permission_p -party_id $user_id -object_id $object_id -privilege $privilege] -} - -ad_proc -deprecated ad_require_permission { - object_id - privilege -} { - permission::require_permission -object_id $object_id -privilege $privilege -} - -ad_proc -private ad_admin_filter {} { - permission::require_permission -object_id [ad_conn object_id] -privilege "admin" - return filter_ok -} - -ad_proc -private ad_user_filter {} { - permission::require_permission -object_id [ad_conn object_id] -privilege "read" - return filter_ok -} - namespace eval permission { ad_proc -public grant { @@ -120,6 +73,14 @@ } } + ad_proc -public inherit_p { + {-object_id:required} + } { + does this object inherit permissions + } { + return [db_string select_inherit_p {} -default 0] + } + ad_proc -public toggle_inherit { {-object_id:required} } { @@ -145,3 +106,52 @@ } } + +ad_proc -deprecated ad_permission_grant { + user_id + object_id + privilege +} { + Grant a permission + + @author ben@openforce +} { + permission::grant -party_id $user_id -object_id $object_id -privilege $privilege +} + +ad_proc -deprecated ad_permission_revoke { + user_id + object_id + privilege +} { + Revoke a permission + + @author ben@openforce +} { + permission::revoke -party_id $user_id -object_id $object_id -privilege $privilege +} + +ad_proc -deprecated ad_permission_p { + {-user_id ""} + object_id + privilege +} { + return [permission::permission_p -party_id $user_id -object_id $object_id -privilege $privilege] +} + +ad_proc -deprecated ad_require_permission { + object_id + privilege +} { + permission::require_permission -object_id $object_id -privilege $privilege +} + +ad_proc -private ad_admin_filter {} { + permission::require_permission -object_id [ad_conn object_id] -privilege "admin" + return filter_ok +} + +ad_proc -private ad_user_filter {} { + permission::require_permission -object_id [ad_conn object_id] -privilege "read" + return filter_ok +} Index: openacs-4/packages/acs-tcl/tcl/acs-permissions-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/acs-permissions-procs.xql,v diff -u -r1.3 -r1.4 --- openacs-4/packages/acs-tcl/tcl/acs-permissions-procs.xql 13 Mar 2002 23:37:26 -0000 1.3 +++ openacs-4/packages/acs-tcl/tcl/acs-permissions-procs.xql 22 Jun 2002 17:07:22 -0000 1.4 @@ -1,16 +1,23 @@ + - - - - select count(*) - from acs_privileges - where privilege = :privilege - - - + + + select count(*) + from acs_privileges + where privilege = :privilege + + + + + select case when security_inherit_p = 't' then 1 else 0 end + from acs_objects + where object_id = :object_id + + + update acs_objects