ad_scope_administrator_p db visitor_idWhat it does:
if scope is not set in the topmost environment then public scope is assumed. if scope=group, it assumes that group_id is set in the topmost environment. if scope=user it assumes that user_id is set in topmost environment (this is user_id of the user who has permission to this page). this procedure will check whether the visitor has the administration rights over the page. if scope=public only site-wide administrator has the right to see the page. if scope=group only administrators of the groups specifed by the group_id are allowed to access the page. if scope=user, only user specified by user_id is allowed to view the page. procedure will return 1 if visitor with user_id equal to visitor_id has right to see the page, otherwide procedure will return 0.Defined in: /web/philip/tcl/ad-scope.tcl
Source code:
if { [uplevel [ad_scope_upvar_level] {info exists scope}] } {
upvar [ad_scope_upvar_level] scope scope
} else {
set scope public
}
switch $scope {
public {
return [ad_administrator_p $visitor_id]
}
group {
upvar [ad_scope_upvar_level] group_id group_id
return [ad_user_group_authorized_admin $visitor_id $group_id $db]
}
user {
upvar [ad_scope_upvar_level] user_id user_id
if { $user_id==$visitor_id } {
return 1
} else {
return 0
}
}
}