Skip to content

Commit 9533b08

Browse files
fix: [UIE-9840] - IAM: Remove Role filter (already assigned roles) in ChangeRoleForEntityDrawer (#13201)
* don't filter out existing roles in ChangeRoleForEntityDrawer * Added changeset: IAM: Remove Role filter (already assigned roles) in ChangeRoleForEntityDrawer
1 parent 7515c1c commit 9533b08

File tree

2 files changed

+9
-12
lines changed

2 files changed

+9
-12
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@linode/manager": Fixed
3+
---
4+
5+
IAM: Remove Role filter (already assigned roles) in ChangeRoleForEntityDrawer ([#13201](https://github.com/linode/manager/pull/13201))

packages/manager/src/features/IAM/Shared/AssignedEntitiesTable/ChangeRoleForEntityDrawer.tsx

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -90,24 +90,16 @@ export const ChangeRoleForEntityDrawer = ({
9090
el.access === role?.access &&
9191
el.value !== role?.role_name;
9292

93-
// Exclude account roles already assigned to the user
9493
if (isAccountRole(el)) {
95-
return (
96-
!assignedRoles?.account_access.includes(el.value) &&
97-
matchesRoleContext
98-
);
94+
return matchesRoleContext;
9995
}
100-
// Exclude entity roles already assigned to the user
96+
10197
if (isEntityRole(el)) {
102-
return (
103-
!assignedRoles?.entity_access.some((entity) =>
104-
entity.roles.includes(el.value)
105-
) && matchesRoleContext
106-
);
98+
return matchesRoleContext;
10799
}
108100
return true;
109101
});
110-
}, [accountRoles, role, assignedRoles]);
102+
}, [accountRoles, role]);
111103

112104
const {
113105
control,

0 commit comments

Comments
 (0)