Shiro 許可權標籤

2021-10-24 07:34:57 字數 607 閱讀 3957

guest標籤

使用者沒有身份驗證時顯示相應資訊,即遊客訪問資訊。

user標籤

使用者已經身份驗證/記住我登入後顯示相應的資訊。

authenticated標籤

使用者已經身份驗證通過,即subject.login登入成功,不是記住我登入的。

notauthenticated標籤

使用者已經身份驗證通過,即沒有呼叫subject.login進行登入,包括記住我自動登入的也屬於未進行身份驗證。

principal標籤

相當於((user)subject.getprincipals()).getusername()。

lackspermission標籤

如果當前subject沒有許可權將顯示body體內容。

hasrole標籤

如果當前subject有角色將顯示body體內容。

hasanyroles標籤

如果當前subject有任意乙個角色(或的關係)將顯示body體內容。

lacksrole標籤

如果當前subject沒有角色將顯示body體內容。

haspermission標籤

如果當前subject有許可權將顯示body體內容

Shiro 許可權標籤 許可權註解

在使用shiro標籤庫前,首先需要在jsp引入shiro標籤 taglib prefix shiro uri shiro authenticated 登入之後 shiro notauthenticated 不在登入狀態時 shiro user 使用者在登入之後或rememberme時 shiro g...

shiro許可權驗證標籤

例項 spring shiro.xml 1 2 3 admin repairtype index roles role admin admin user roles role admin admin complaint list roles role service,role admin jsp頁面...

shiro許可權驗證標籤

例項 spring shiro.xml 1 2 3 admin repairtype index roles role admin admin user roles role admin admin complaint list roles role service,role admin jsp頁面...