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 -N -r1.24 -r1.25 --- openacs-4/packages/acs-tcl/tcl/acs-permissions-procs.tcl 20 Apr 2004 21:13:04 -0000 1.24 +++ openacs-4/packages/acs-tcl/tcl/acs-permissions-procs.tcl 29 Jun 2004 10:17:44 -0000 1.25 @@ -46,21 +46,28 @@ # args to permission_p and permission_p_no_cache must match ad_proc -public permission::permission_p { + {-no_login:boolean} {-no_cache:boolean} {-party_id ""} {-object_id:required} {-privilege:required} } { does party X have privilege Y on object Z - @param nocache force loading from db even if cached (flushes cache as well) + @param no_cache force loading from db even if cached (flushes cache as well) + + @param no_login Don't bump to registration to refresh authentication, if the user's authentication is expired. + This is specifically required in the case where you're calling this from the proc that gets + the login page. + @param party_id if null then it is the current user_id + + @param object_id The object you want to check permissions on. + + @param privilege The privilege you want to check for. } { if { [empty_string_p $party_id] } { set party_id [ad_conn user_id] - set no_party_p 1 - } else { - set no_party_p 0 } if { $no_cache_p } { @@ -76,7 +83,13 @@ [parameter::get -package_id [ad_acs_kernel_id] -parameter PermissionCacheTimeout -default 300]] } - if { $no_party_p && [ad_conn user_id] == 0 && [ad_conn untrusted_user_id] != 0 && ![template::util::is_true $permission_p] } { + if { + !$no_login_p + && [ad_conn user_id] == 0 + && $party_id == 0 + && [ad_conn untrusted_user_id] != 0 + && ![template::util::is_true $permission_p] + } { set untrusted_permission_p [permission_p_not_cached \ -party_id [ad_conn untrusted_user_id] \ -object_id $object_id \