mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
RBAC: prioritise directly applied permissions over inherited permissions (#80212)
show directly applied permissions over inherited permissions
This commit is contained in:
parent
310ad0474c
commit
0f4e123de0
@ -27,6 +27,12 @@ export const PermissionList = ({ title, items, compareKey, permissionLevels, can
|
||||
|
||||
if (item.actions.length > keep[key].actions.length) {
|
||||
keep[key] = item;
|
||||
continue;
|
||||
}
|
||||
|
||||
// If the same permission has been inherited and applied directly, keep the one that is applied directly
|
||||
if (item.actions.length === keep[key].actions.length && !item.isInherited) {
|
||||
keep[key] = item;
|
||||
}
|
||||
}
|
||||
return Object.keys(keep).map((k) => keep[k]);
|
||||
|
Loading…
Reference in New Issue
Block a user