rename super user to admin and middleware refactoring

This commit is contained in:
Milo Schwartz
2024-11-05 22:38:57 -05:00
parent 7b755a273c
commit 03051878ef
26 changed files with 790 additions and 529 deletions

View File

@@ -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`
)
);
}

View File

@@ -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,

View File

@@ -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`
)
);
}