Remove event self-creation check in middleware

This commit is contained in:
Regalijan 2024-02-20 16:54:07 -05:00
parent 042f67ea7d
commit efbac1cf00
Signed by: regalijan
GPG Key ID: 5D4196DA269EF520

View File

@ -14,10 +14,7 @@ export async function onRequest(context: RequestContext) {
if (!eventInfo) return jsonError("This event does not exist.", 404); if (!eventInfo) return jsonError("This event does not exist.", 404);
if ( if (![1 << 4, 1 << 12].find((p) => context.data.current_user.permissions & p))
eventInfo.created_by !== context.data.current_user.id &&
![1 << 4, 1 << 12].find((p) => context.data.current_user.permissions & p)
)
return jsonError("You cannot manage this event.", 403); return jsonError("You cannot manage this event.", 403);
context.data.event = eventInfo; context.data.event = eventInfo;