RBAC: prioritise directly applied permissions over inherited permissions (#80212)
show directly applied permissions over inherited permissions
This commit is contained in:
@@ -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]);
|
||||
|
||||
Reference in New Issue
Block a user