Skip to content

Commit d77c8b5

Browse files
authored
fix admin access (#1206)
1 parent ecdbba3 commit d77c8b5

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

src/routes/(app)/admin/access/+page.server.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import * as m from "$paraglide/messages";
99

1010
export const load: PageServerLoad = async ({ locals }) => {
1111
const { prisma, user } = locals;
12-
authorize(apiNames.ACCESS_POLICY.UPDATE, user);
12+
authorize(apiNames.ACCESS_POLICY.CREATE, user);
1313

1414
const accessPolicies = await prisma.accessPolicy.findMany().then((policies) =>
1515
policies

src/routes/(app)/admin/access/[apiName]/+page.server.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export type DeleteSchema = Infer<typeof deleteSchema>;
3333

3434
export const load: PageServerLoad = async ({ locals, params }) => {
3535
const { prisma, user } = locals;
36-
authorize(apiNames.ACCESS_POLICY.UPDATE, user);
36+
authorize(apiNames.ACCESS_POLICY.CREATE, user);
3737

3838
const policies = await prisma.accessPolicy.findMany({
3939
where: {

src/routes/(app)/admin/access/positions/+page.server.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const createPolicySchema = z.object({
1515
export const load: PageServerLoad = async ({ locals }) => {
1616
const { prisma, user } = locals;
1717

18-
authorize(apiNames.ACCESS_POLICY.UPDATE, user);
18+
authorize(apiNames.ACCESS_POLICY.CREATE, user);
1919

2020
const accesspolicies = await prisma.accessPolicy.findMany({
2121
select: { role: true, apiName: true, id: true },

0 commit comments

Comments
 (0)