mirror of
https://github.com/casdoor/casdoor.git
synced 2025-05-24 08:20:31 +08:00
Fix missing accountItem crash bug
This commit is contained in:
parent
ace8e9da06
commit
7e0ea0b8d9
@ -211,6 +211,10 @@ func GetAccountItemByName(name string, organization *Organization) *AccountItem
|
|||||||
}
|
}
|
||||||
|
|
||||||
func CheckAccountItemModifyRule(accountItem *AccountItem, user *User, lang string) (bool, string) {
|
func CheckAccountItemModifyRule(accountItem *AccountItem, user *User, lang string) (bool, string) {
|
||||||
|
if accountItem == nil {
|
||||||
|
return true, ""
|
||||||
|
}
|
||||||
|
|
||||||
switch accountItem.ModifyRule {
|
switch accountItem.ModifyRule {
|
||||||
case "Admin":
|
case "Admin":
|
||||||
if user == nil || !user.IsAdmin && !user.IsGlobalAdmin {
|
if user == nil || !user.IsAdmin && !user.IsGlobalAdmin {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user