Remove event self-creation check in middleware
This commit is contained in:
parent
042f67ea7d
commit
efbac1cf00
@ -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;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user