fix for default roles (#32243)
Signed-off-by: Agnieszka Gancarczyk <agagancarczyk@gmail.com>
This commit is contained in:
parent
aee9390812
commit
b2999ada2d
1 changed files with 9 additions and 1 deletions
|
@ -107,6 +107,7 @@ export const RoleMapping = ({
|
|||
const loader = async () => {
|
||||
let effectiveRoles: Row[] = [];
|
||||
let effectiveClientRoles: Row[] = [];
|
||||
|
||||
if (!hide) {
|
||||
effectiveRoles = await getEffectiveRoles(adminClient, type, id);
|
||||
|
||||
|
@ -119,6 +120,13 @@ export const RoleMapping = ({
|
|||
client: { clientId: e.client, id: e.clientId },
|
||||
role: { id: e.id, name: e.role, description: e.description },
|
||||
}));
|
||||
|
||||
effectiveRoles = effectiveRoles.filter(
|
||||
(role) =>
|
||||
!effectiveClientRoles.some(
|
||||
(clientRole) => clientRole.role.id === role.role.id,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
const roles = await getMapping(adminClient, type, id);
|
||||
|
@ -135,7 +143,7 @@ export const RoleMapping = ({
|
|||
|
||||
return [
|
||||
...mapRoles(
|
||||
[...realmRolesMapping, ...clientMapping],
|
||||
[...clientMapping, ...realmRolesMapping],
|
||||
[...effectiveClientRoles, ...effectiveRoles],
|
||||
hide,
|
||||
),
|
||||
|
|
Loading…
Reference in a new issue