Hi Charitha,

You can use following OSGi Service.

*org.wso2.carbon.user.core.service.RealmService*

Then you can get AuthorizationManager from the Service as below.

*int tenantID = realmService.getTenantManager().getTenantId(domainName); *
*UserRealm userRealm = realmService.getTenantUserRealm(tenantID);*
*AuthorizationManager authorizationManager =
userRealm.getAuthorizationManager();*


>From the AuthorizationManager, you can get and set permissions.

Thank You.
Lakshani.

On Wed, Jul 22, 2015 at 7:48 AM, Charitha Goonetilleke <charit...@wso2.com>
wrote:

> Hi All,
>
> I need to get and set permissions for Role via OSGi service. Is there any
> way to get it?
>
> --
> *Charitha Goonetilleke*
> Software Engineer
> WSO2 Inc.; http://wso2.com
> lean.enterprise.middleware
>
> mobile: +94 77 751 3669 <%2B94777513669>
> Twitter:@CharithaWs <https://twitter.com/CharithaWs>, fb: charithag
> <https://www.facebook.com/charithag>, linkedin: charithag
> <http://www.linkedin.com/in/charithag>
>
> _______________________________________________
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 
Lakshani Gamage

*Software Engineer*
Mobile : +94 (0) 71 5478184 <%2B94%20%280%29%20773%20451194>
_______________________________________________
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to