mirror of
https://github.com/casdoor/casdoor.git
synced 2025-05-24 08:20:31 +08:00
feat: disable role and permission update and checks when updating user (#1466)
This commit is contained in:
parent
c93bc0dda2
commit
9ca686b240
@ -95,20 +95,6 @@ func checkPermissionForUpdateUser(userId string, newUser object.User, c *ApiCont
|
||||
itemsChanged = append(itemsChanged, item)
|
||||
}
|
||||
|
||||
oldUserRolesJson, _ := json.Marshal(oldUser.Roles)
|
||||
newUserRolesJson, _ := json.Marshal(newUser.Roles)
|
||||
if string(oldUserRolesJson) != string(newUserRolesJson) {
|
||||
item := object.GetAccountItemByName("Roles", organization)
|
||||
itemsChanged = append(itemsChanged, item)
|
||||
}
|
||||
|
||||
oldUserPermissionJson, _ := json.Marshal(oldUser.Permissions)
|
||||
newUserPermissionJson, _ := json.Marshal(newUser.Permissions)
|
||||
if string(oldUserPermissionJson) != string(newUserPermissionJson) {
|
||||
item := object.GetAccountItemByName("Permissions", organization)
|
||||
itemsChanged = append(itemsChanged, item)
|
||||
}
|
||||
|
||||
oldUserPropertiesJson, _ := json.Marshal(oldUser.Properties)
|
||||
newUserPropertiesJson, _ := json.Marshal(newUser.Properties)
|
||||
if string(oldUserPropertiesJson) != string(newUserPropertiesJson) {
|
||||
|
@ -110,8 +110,8 @@ type User struct {
|
||||
Ldap string `xorm:"ldap varchar(100)" json:"ldap"`
|
||||
Properties map[string]string `json:"properties"`
|
||||
|
||||
Roles []*Role `json:"roles"`
|
||||
Permissions []*Permission `json:"permissions"`
|
||||
Roles []*Role `xorm:"-" json:"roles"`
|
||||
Permissions []*Permission `xorm:"-" json:"permissions"`
|
||||
|
||||
LastSigninWrongTime string `xorm:"varchar(100)" json:"lastSigninWrongTime"`
|
||||
SigninWrongTimes int `json:"signinWrongTimes"`
|
||||
|
Loading…
x
Reference in New Issue
Block a user