You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@shiro.apache.org by scSynergy <ro...@scsynergy.de> on 2015/10/07 09:24:37 UTC

Re: Working with isPermitted(PrincipalCollection, Permission)

Of course we all know how to implement AuthorizingRealm; this whole forum is
full of examples on how to do it. Two examples I found in under 15 seconds:
http://shiro-user.582556.n2.nabble.com/Example-Shiro-MongoDB-Realm-td7579029.html
http://shiro-user.582556.n2.nabble.com/How-to-add-a-role-to-the-subject-td5562700.html

To retrieve the name from the PrincipalCollection 'pc':
for (Object tmp : pc.fromRealm(getClass().getName())) {
    String name = tmp.toString();
...
}

To extract the permission string from the permission 'permission':
   String permissionString = permission.toString();



--
View this message in context: http://shiro-user.582556.n2.nabble.com/Working-with-isPermitted-PrincipalCollection-Permission-tp7580805p7580808.html
Sent from the Shiro User mailing list archive at Nabble.com.