mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-08-13 13:04:48 -05:00
Ensure supporters have CALENDAR_EVENT_ADDER
This was already handled in the loader but not action
This commit is contained in:
@@ -11,9 +11,7 @@ import { canEditCalendarEvent } from "../calendar-utils";
|
||||
|
||||
export const loader = async ({ request }: LoaderFunctionArgs) => {
|
||||
const user = await requireUser(request);
|
||||
if (!user.roles.includes("SUPPORTER")) {
|
||||
requireRole(user, "CALENDAR_EVENT_ADDER");
|
||||
}
|
||||
requireRole(user, "CALENDAR_EVENT_ADDER");
|
||||
|
||||
const url = new URL(request.url);
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ export function userRoles(
|
||||
result.push("TOURNAMENT_ADDER");
|
||||
}
|
||||
|
||||
if (userDiscordIdIsAged(user)) {
|
||||
if (userDiscordIdIsAged(user) || isSupporter(user)) {
|
||||
result.push("CALENDAR_EVENT_ADDER");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user