Forum OpenACS Q&A: How to figure out if a user has at least one admin role in an OpenACS instance?

Hi all,
can someone kindly give me a hint how I can figure out programmatically if a current user has at least one admin role within the OpenACS instance? I need this info for a support package.

Greetings,
Nima

Use the acs_object_party_privilege_map view to check if a row exists with privilege = 'admin' and party_id = :user_id ...

That will check if the user has the admin privilege on at least one object in the system.

If by "admin role in the OpenACS instance" you mean something like admin on at least one subsite instance or admin on at least one package instance you'll have to do something like join that view using its object_id and the site map or apm entries etc ...