isUserAuthorized() method in Authorization Manager can be used for this.
For example,
realm.getAuthorizationManager().
isUserAuthorized(username, "/permission/admin/login",
CarbonConstants.UI_PERMISSION_ACTION);
Thanks,
Thilina
On Mon, May 7, 2012 at 10:40 PM, Hiranya Jayathilaka <[email protected]>wrote:
> Hi,
>
> I want to check whether a given user has a particular permission. Is there
> some API in Carbon to do this?
>
> Our requirement is that we have a Java API and we want to make sure that
> some of the methods in this API can only be invoked by users with
> particular permissions. What is the best way to implement something like
> this?
>
> Thanks,
> Hirana
>
> --
> Hiranya Jayathilaka
> Senior Technical Lead;
> WSO2 Inc.; http://wso2.org
> E-mail: [email protected]; Mobile: +94 77 633 3491
> Blog: http://techfeast-hiranya.blogspot.com
>
> _______________________________________________
> Dev mailing list
> [email protected]
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>
--
Thilina Buddhika
Associate Technical Lead
WSO2 Inc. ; http://wso2.com
lean . enterprise . middleware
phone : +94 77 44 88 727
blog : http://blog.thilinamb.com
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev