1
0
mirror of https://github.com/sasjs/server.git synced 2025-12-10 19:34:34 +00:00

fix: do not show admin users in add permission modal

This commit is contained in:
2022-06-26 01:49:07 +05:00
parent 4ddfec0403
commit a75edbaa32
2 changed files with 8 additions and 2 deletions

View File

@@ -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) => {

View File

@@ -2,6 +2,7 @@ export interface UserResponse {
id: number
username: string
displayName: string
isAdmin: boolean
}
export interface GroupResponse {