summary refs log tree commit diff
path: root/src/routes
diff options
context:
space:
mode:
authorFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-04-23 00:14:54 +0200
committerFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-04-23 00:14:54 +0200
commit696ef6278ab6a4f48f5bc6ef46571691127b80be (patch)
tree3d9e95d24fbe0c8242fe7f23e7249362a7f5a329 /src/routes
parentnpm i @fosscord/server-util (diff)
downloadserver-696ef6278ab6a4f48f5bc6ef46571691127b80be.tar.xz
:bug: fix wrong permission in delete invite
Diffstat (limited to 'src/routes')
-rw-r--r--src/routes/invites/index.ts3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/routes/invites/index.ts b/src/routes/invites/index.ts
index 7ffceb25..7f4ff59b 100644
--- a/src/routes/invites/index.ts
+++ b/src/routes/invites/index.ts
@@ -21,7 +21,8 @@ router.delete("/:invite_code", async (req: Request, res: Response) => {
 	const { guild_id, channel_id } = invite;
 	const perms = await getPermission(req.user_id, guild_id, channel_id);
 
-	if (!perms.has("MANAGE_GUILD") || !perms.has("MANAGE_CHANNELS")) throw new HTTPError("You aren't allow", 401);
+	if (!perms.has("MANAGE_GUILD") && !perms.has("MANAGE_CHANNELS"))
+		throw new HTTPError("You missing the MANAGE_GUILD or MANAGE_CHANNELS permission", 401);
 
 	await InviteModel.deleteOne({ code }).exec();