We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b1ba19e commit 7fb2a92Copy full SHA for 7fb2a92
src/routes/workbooks/create/+page.server.ts
@@ -47,6 +47,11 @@ export const actions = {
47
return fail(FORBIDDEN, { message: 'ログインが必要です。' });
48
}
49
50
+ // Security check: Only admins can create workbooks
51
+ if (author.role !== Roles.ADMIN) {
52
+ return fail(FORBIDDEN, { message: '管理者のみ問題集を作成できます。' });
53
+ }
54
+
55
const form = await superValidate(request, zod(workBookSchema));
56
57
if (!form.valid) {
0 commit comments