- Topics: Active | Unanswered
Pages: 1
Topic closed
#1 2009-11-16 12:42:46
- **_keithl8041_**
how to determine whether the current user is an administrator
Hi,
For various reasons, I need to determine whether the currently logged-in user is part of the Administrators group. I'm using the XML API. Can someone tell me the easiest way of doing this or refer me to a resource which can help? I've checked the API documentation but can't seem to find anything relevant.
Thanks for your help.
Keith
Offline
#2 2009-11-16 16:45:50
- **_gajett_**
Re: how to determine whether the current user is an administrator
the 'using enterprise web services' pdf, has, on page 40 under 'check which users are in a group' info which should point you in the right direction. (your page # may differ, I've had the doc for a while. search for 'check which users are in a group' the chapter is called 'Basics')
If you know the person's principal-id you can run this:
http://your.url/api/xml?action=principal-list&group-id=XXXyradmingroupid&filter-is-member=true
use your url, and your admin group id#
This will return all admins, iterate through for the principal id you are looking for.
or, the next section of the same document shows how to list all groups a user belongs to.
there's a link to the enterprise web services pdf here: http://www.adobe.com/support/connect/documentation.html
Greg
Offline
#3 2009-11-17 08:52:56
- **_keithl8041_**
Re: how to determine whether the current user is an administrator
Thanks for your quick reply - very useful! For anyone else wishing to do the same, here's the process;
- call common-info to get the logged-in-users principal id (called userId)
- call principal-list with a filter of "filter-type=admins" to get the principal-id of the admin group
- call principal-list again with "group-id=[admin-principal-id]&filter-is-member=true" and loop through each of the returned nodes looking for the user-principal-id which you got in step 1.
Last edited by **_keithl8041_** (2009-11-20 11:42:22)
Offline
Pages: 1
Topic closed