3

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

Jan
  • 13,738
  • 3
  • 30
  • 55
J John
  • 299
  • 1
  • 3
  • 15

2 Answers2

0

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 e.g. roles are checked.

Abaddon666
  • 1,533
  • 15
  • 31
  • thanks for your answer,seems I haven't understood the mechanism of it .(it's my first question here :D) – J John Jan 09 '16 at 13:38
0

Whenever the method hasRole or isPermitted is called by the Shiro Subject this method is invoked.