mirror of
https://github.com/sasjs/server.git
synced 2025-12-10 11:24:35 +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) => {
|
||||
|
||||
@@ -2,6 +2,7 @@ export interface UserResponse {
|
||||
id: number
|
||||
username: string
|
||||
displayName: string
|
||||
isAdmin: boolean
|
||||
}
|
||||
|
||||
export interface GroupResponse {
|
||||
|
||||
Reference in New Issue
Block a user