關於何時執行shiro AuthorizingRealm 里的 doGetAuthenticationInfo與doGetAuthorizationInfo


1.doGetAuthenticationInfo執行時機如下

 

當調用Subject currentUser = SecurityUtils.getSubject();

currentUser.login(token);

 

 

2.doGetAuthorizationInfo執行時機有三個,如下:

 

1、subject.hasRole(“admin”) 或 subject.isPermitted(“admin”):自己去調用這個是否有什么角色或者是否有什么權限的時候;

2、@RequiresRoles("admin") :在方法上加注解的時候;

3、[@shiro.hasPermission name = "admin"][/@shiro.hasPermission]:在頁面上加shiro標簽的時候,即進這個頁面的時候掃描到有這個標簽的時候。

 

參考http://blog.csdn.net/u014082617/article/details/50949386


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



猜您在找 shiro doGetAuthenticationInfo shiro筆記-AuthenticatingRealm和AuthorizingRealm關系 項目報錯小記——項目報異常java.lang.IllegalArgumentException: object is not an instance of declaring class及不執行shiro的doGetAuthorizationInfo方法 org.apache.shiro.realm.AuthorizingRealm - No cache or cacheManager properties have been set. Authorization cache cannot be obtained. 執行 innerHTML 里的