Forum OpenACS Development: Site wide admin privilieges

how to know a particular user(user_id) given whether he is having the site-wide admin priviliges ,
if there is an api for this can any body please help me out

thanks for helping out
vamshi

Collapse
Posted by Tom Ayles on

Hi Vamshi,

Site-wide administrators always have admin privileges on the security root context, which is an acs_magic_object. So, to check if a user (assume with the ID in the variable user_id) has site-wide admin privileges, make the following call:

permission::permission_p \
    -object_id [acs_magic_object security_root_context] \
    -party_id $user_id \
    -privilege admin

It will return true if the user has SW admin privilege. This works on 4.6.3, I think its the same in 5. Hope this fixes your problem!

Collapse
Posted by Vamshi Krishna Kaniganti on
Thanks Tom Ayles
i got it