[Building Sakai] way to tell if current user has admin privileges?

Aaron Zeckoski azeckoski at unicon.net
Wed Mar 31 11:02:24 PDT 2010


There is a method in DeveloperHelperService for this or you can do it
manually like so:
securityService.isSuperUser(userId);

-AZ


On Wed, Mar 31, 2010 at 6:49 PM, Nicola Monat-Jacobs
<nicola at longsight.com> wrote:
> Ah, I think I should have been more specific. I'm working on a custom sakai tool, and I'm wondering if there is a java method to determine this? Many tools treat users enrolled in the admin workspace as though they were admin, so I imagine there must be some way to test for it.
>
> Thanks,
> Nicola
>
> On Mar 31, 2010, at  10:43 AM, Noah Botimer wrote:
>
>> Yes. Being in Admin Workspace is the magic and sole deciding factor. There should only be one role, so there shouldn't be any confusion there.
>>
>> A way to check as the user would be to try to visit /portal/site/!admin. I'm sure we could come up with something programmatic/scriptable if you needed.
>>
>> Thanks,
>> -Noah
>>
>> On Mar 31, 2010, at 1:36 PM, Nicola Monat-Jacobs wrote:
>>
>>> I may be forgetting something obvious, but is there any easy way or method to tell if the current user has admin privileges? Not the 'admin' user, but a regular user who is enrolled in the Admin Workspace?
>>>
>>> Thanks,
>>> Nicola
>>> _______________________________________________
>>> sakai-dev mailing list
>>> sakai-dev at collab.sakaiproject.org
>>> http://collab.sakaiproject.org/mailman/listinfo/sakai-dev
>>>
>>> TO UNSUBSCRIBE: send email to sakai-dev-unsubscribe at collab.sakaiproject.org with a subject of "unsubscribe"
>>>
>>>
>>
>
> _______________________________________________
> sakai-dev mailing list
> sakai-dev at collab.sakaiproject.org
> http://collab.sakaiproject.org/mailman/listinfo/sakai-dev
>
> TO UNSUBSCRIBE: send email to sakai-dev-unsubscribe at collab.sakaiproject.org with a subject of "unsubscribe"
>



-- 
Aaron Zeckoski - Software Engineer - http://tinyurl.com/azprofile


More information about the sakai-dev mailing list