Just an Idea. If you have 2 sets: the permissions in the database and the permissions in shiro you can iterate over all your permissions and using isPermited method you can store the permissions of shiro in a list.
2014-07-04 6:40 GMT-05:00 Marc Logemann <[email protected]>: > Hi, > > of course i have the rights as 1:n relation from the user. But my realm in > shiro does some more magic. It checks if the admin role is present and > copies all permissions to the Subject. So i am not in sync with my database > anymore but shiro has the "correct" setting. > > So i cant just ask the database for all permissions, i need shiro to get > them to me. But this is a REAL hassle. To me the Subject interface lacks a > getAllPermissions(). > > Any ideas how to get the list of permissions from Shiro? > > > > > 2014-07-04 2:51 GMT+02:00 juan manuel rojas ronquillo > <[email protected]>: > >> I don't know if this is posible. I never needed that, my dynamic >> permissions are in a database so I can fetch them. >> Can you detail your configuration and your use case so others can help? >> >> 2014-07-03 17:53 GMT-05:00 Marc Logemann <[email protected]>: >> > Hi, >> > >> > using Shiro for some years now but currently facing an issue i cant >> > solve. I >> > want to get back all permissions. Looking at the API, i ve found a >> > getAuthorizationInfo() method. Unfortunately its protected so that i >> > cant >> > call it from my service class where i injected my custom realm. >> > >> > I am also quite sure that injecting a realm is not a very nice way doing >> > things. But SecurityUtils.getSubject() doesnt get me anywhere in terms >> > of >> > getting permissions. >> > >> > I think if getAuthorizationInfo() would be public, i could simple get a >> > SimpleAuthorizationInfo object and everything is nice. Do i miss >> > something >> > obvious here? >> > >> > Thanks for input. >> > >> > Marc > >
