mirror of
https://github.com/sasjs/server.git
synced 2026-01-04 21:30:05 +00:00
fix: do not show admin users in add permission modal
This commit is contained in:
@@ -66,8 +66,13 @@ const AddPermissionModal = ({
|
||||
.get(`/SASjsApi/${principalType}`)
|
||||
.then((res: any) => {
|
||||
if (res.data) {
|
||||
if (principalType === 'user') setUserPrincipals(res.data)
|
||||
else setGroupPrincipals(res.data)
|
||||
if (principalType === 'user') {
|
||||
const users: UserResponse[] = res.data
|
||||
const nonAdminUsers = users.filter((user) => !user.isAdmin)
|
||||
setUserPrincipals(nonAdminUsers)
|
||||
} else {
|
||||
setGroupPrincipals(res.data)
|
||||
}
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
|
||||
Reference in New Issue
Block a user