shiro-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From juan manuel rojas ronquillo <juanro...@rhemsolutions.com>
Subject Re: get ALL permissions via API
Date Fri, 04 Jul 2014 15:18:37 GMT
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 <marc.logemann@gmail.com>:
> 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
> <juanrojas@rhemsolutions.com>:
>
>> 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 <marc.logemann@gmail.com>:
>> > 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
>
>

Mime
View raw message