mirror of
https://github.com/casdoor/casdoor.git
synced 2025-07-03 12:30:19 +08:00
fix(secure): remove user list from roles and permissions field to avoid leaking userlist (#1614)
* fix(secure): remove user list from roles and permissions field to avoid leaking userlist Signed-off-by: fengxsong <fengxsong@outlook.com> * Update permission.go * Update role.go --------- Signed-off-by: fengxsong <fengxsong@outlook.com> Co-authored-by: hsluoyz <hsluoyz@qq.com>
This commit is contained in:
@ -159,6 +159,10 @@ func GetRolesByUser(userId string) []*Role {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
for i := range roles {
|
||||
roles[i].Users = nil
|
||||
}
|
||||
|
||||
return roles
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user