简体   繁体   中英

When does the method doGetAuthorizationInfo get called in Shiro?

I'm really confused about this.

Sometimes it runs, sometimes not. Can someone provide insight into the conditions under which doGetAuthorizationInfo will be called?

Thanks

In the Shiro Docs :

This implementation obtains the actual AuthorizationInfo object from the subclass's implementation of doGetAuthorizationInfo, and then caches it for efficient reuse if caching is enabled

The function, as to my experience, is only called when the authorization info is actually needed. If Shiro is configured to use a cache it will not call it every time eg roles are checked.

Shiro Subject每次调用hasRole或isPermitted方法时,都会调用此方法。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM