mirror of
https://github.com/sasjs/server.git
synced 2025-12-11 19:44: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}`)
|
.get(`/SASjsApi/${principalType}`)
|
||||||
.then((res: any) => {
|
.then((res: any) => {
|
||||||
if (res.data) {
|
if (res.data) {
|
||||||
if (principalType === 'user') setUserPrincipals(res.data)
|
if (principalType === 'user') {
|
||||||
else setGroupPrincipals(res.data)
|
const users: UserResponse[] = res.data
|
||||||
|
const nonAdminUsers = users.filter((user) => !user.isAdmin)
|
||||||
|
setUserPrincipals(nonAdminUsers)
|
||||||
|
} else {
|
||||||
|
setGroupPrincipals(res.data)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ export interface UserResponse {
|
|||||||
id: number
|
id: number
|
||||||
username: string
|
username: string
|
||||||
displayName: string
|
displayName: string
|
||||||
|
isAdmin: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface GroupResponse {
|
export interface GroupResponse {
|
||||||
|
|||||||
Reference in New Issue
Block a user