mirror of
https://github.com/rancher/steve.git
synced 2025-04-30 04:03:46 +00:00
fix(accesscontrol): CacheKey could not be stable
This commit is contained in:
parent
4787160614
commit
435e220795
@ -76,11 +76,11 @@ func (l *AccessStore) CacheKey(user user.Info) string {
|
|||||||
l.users.addRolesToHash(d, user.GetName())
|
l.users.addRolesToHash(d, user.GetName())
|
||||||
|
|
||||||
groupBase := user.GetGroups()
|
groupBase := user.GetGroups()
|
||||||
groups := make([]string, 0, len(groupBase))
|
groups := make([]string, len(groupBase))
|
||||||
copy(groups, groupBase)
|
copy(groups, groupBase)
|
||||||
|
|
||||||
sort.Strings(groups)
|
sort.Strings(groups)
|
||||||
for _, group := range user.GetGroups() {
|
|
||||||
|
for _, group := range groups {
|
||||||
l.groups.addRolesToHash(d, group)
|
l.groups.addRolesToHash(d, group)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user