mirror of
https://github.com/casdoor/casdoor.git
synced 2025-07-03 12:30:19 +08:00
fix: fix update score permission check (#2335)
* fix: Fixed the missing permission check when updating the score field. * Update object/user_util.go
This commit is contained in:
@ -320,6 +320,11 @@ func CheckPermissionForUpdateUser(oldUser, newUser *User, isAdmin bool, lang str
|
|||||||
itemsChanged = append(itemsChanged, item)
|
itemsChanged = append(itemsChanged, item)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if oldUser.Score != newUser.Score {
|
||||||
|
item := GetAccountItemByName("Score", organization)
|
||||||
|
itemsChanged = append(itemsChanged, item)
|
||||||
|
}
|
||||||
|
|
||||||
for i := range itemsChanged {
|
for i := range itemsChanged {
|
||||||
if pass, err := CheckAccountItemModifyRule(itemsChanged[i], isAdmin, lang); !pass {
|
if pass, err := CheckAccountItemModifyRule(itemsChanged[i], isAdmin, lang); !pass {
|
||||||
return pass, err
|
return pass, err
|
||||||
|
Reference in New Issue
Block a user