Home
The Toolkit for Online Communities
15903 Community Members, 0 members online, 2400 visitors today
Log In Register

Forum OpenACS Development: Site wide admin privilieges

OpenACS Home : Forums : OpenACS Development : Site wide admin privilieges

Icon of Envelope Request notifications

+
Posted by Vamshi Krishna Kaniganti on
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

+
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!

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