mirror of
https://github.com/fosrl/pangolin.git
synced 2026-02-23 13:26:41 +00:00
rename super user to admin and middleware refactoring
This commit is contained in:
@@ -61,11 +61,11 @@ export async function deleteRole(
|
||||
);
|
||||
}
|
||||
|
||||
if (role[0].isSuperUserRole) {
|
||||
if (role[0].isAdmin) {
|
||||
return next(
|
||||
createHttpError(
|
||||
HttpCode.FORBIDDEN,
|
||||
`Cannot delete a Super User role`
|
||||
`Cannot delete a Admin role`
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -80,7 +80,7 @@ export async function listRoles(
|
||||
.select({
|
||||
roleId: roles.roleId,
|
||||
orgId: roles.orgId,
|
||||
isSuperUserRole: roles.isSuperUserRole,
|
||||
isAdmin: roles.isAdmin,
|
||||
name: roles.name,
|
||||
description: roles.description,
|
||||
orgName: orgs.name,
|
||||
|
||||
@@ -81,11 +81,11 @@ export async function updateRole(
|
||||
);
|
||||
}
|
||||
|
||||
if (role[0].isSuperUserRole) {
|
||||
if (role[0].isAdmin) {
|
||||
return next(
|
||||
createHttpError(
|
||||
HttpCode.FORBIDDEN,
|
||||
`Cannot update a Super User role`
|
||||
`Cannot update a Admin role`
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user