Index: openacs-4/packages/xotcl-core/tcl/context-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xotcl-core/tcl/context-procs.tcl,v diff -u -r1.26 -r1.27 --- openacs-4/packages/xotcl-core/tcl/context-procs.tcl 14 Nov 2007 11:59:17 -0000 1.26 +++ openacs-4/packages/xotcl-core/tcl/context-procs.tcl 15 Nov 2007 12:49:47 -0000 1.27 @@ -278,6 +278,28 @@ return [my set $key] } + ConnectionContext instproc role=swa {-user_id:required -object_id} { + return [my cache [list acs_user::site_wide_admin_p -user_id $user_id]] + } + ConnectionContext instproc role=registered_user {-user_id:required -object_id} { + return [expr {$user_id != 0}] + } + ConnectionContext instproc role=unregistered_user {-user_id:required -object_id} { + return [expr {$user_id == 0}] + } + ConnectionContext instproc role=admin {-user_id:required -object_id:required} { + return [my permission -object_id $object_id -privilege admin -party_id $user_id] + } + ConnectionContext instproc role=creator {-user_id:required -object_id -object:required} { + $object instvar creation_user + return [expr {$creation_user == $user_id}] + } + ConnectionContext instproc role=app_group_member {-user_id:required -object_id} { + return [my cache [list application_group::contains_party_p \ + -party_id $user_id \ + -package_id $object_id]] + } + ConnectionContext ad_instproc permission {-object_id -privilege -party_id } { call ::permission::permission_p but avoid multiple calls in the same session through caching in the connection context