mirror of
https://github.com/fosrl/pangolin.git
synced 2026-03-06 18:56:39 +00:00
Fix #1376
This commit is contained in:
@@ -82,6 +82,7 @@ authenticated.delete(
|
|||||||
"/org/:orgId",
|
"/org/:orgId",
|
||||||
verifyOrgAccess,
|
verifyOrgAccess,
|
||||||
verifyUserIsOrgOwner,
|
verifyUserIsOrgOwner,
|
||||||
|
verifyUserHasAction(ActionsEnum.deleteOrg),
|
||||||
org.deleteOrg
|
org.deleteOrg
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -49,19 +49,7 @@ export async function deleteOrg(
|
|||||||
}
|
}
|
||||||
|
|
||||||
const { orgId } = parsedParams.data;
|
const { orgId } = parsedParams.data;
|
||||||
// Check if the user has permission to list sites
|
|
||||||
const hasPermission = await checkUserActionPermission(
|
|
||||||
ActionsEnum.deleteOrg,
|
|
||||||
req
|
|
||||||
);
|
|
||||||
if (!hasPermission) {
|
|
||||||
return next(
|
|
||||||
createHttpError(
|
|
||||||
HttpCode.FORBIDDEN,
|
|
||||||
"User does not have permission to perform this action"
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
const [org] = await db
|
const [org] = await db
|
||||||
.select()
|
.select()
|
||||||
.from(orgs)
|
.from(orgs)
|
||||||
|
|||||||
Reference in New Issue
Block a user