mirror of
https://github.com/fosrl/pangolin.git
synced 2025-08-04 10:05:53 +02:00
setup server admin
This commit is contained in:
parent
e0b1aa98e0
commit
4a1e869e58
29 changed files with 409 additions and 251 deletions
|
@ -28,6 +28,18 @@ export async function createOrg(
|
|||
next: NextFunction
|
||||
): Promise<any> {
|
||||
try {
|
||||
// should this be in a middleware?
|
||||
if (config.flags?.disable_user_create_org) {
|
||||
if (!req.user?.serverAdmin) {
|
||||
return next(
|
||||
createHttpError(
|
||||
HttpCode.FORBIDDEN,
|
||||
"Only server admins can create organizations"
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
const parsedBody = createOrgSchema.safeParse(req.body);
|
||||
if (!parsedBody.success) {
|
||||
return next(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue