diff --git a/src/mockServer/msw-handlers.ts b/src/mockServer/msw-handlers.ts index faed4e21..f6fe73b7 100644 --- a/src/mockServer/msw-handlers.ts +++ b/src/mockServer/msw-handlers.ts @@ -191,7 +191,8 @@ export const buildMSWMocks = ( const memberId = getMemberIdFromToken(req.headers.get('Authorization')); const member = await getMemberFromId(memberId); const permission = await getPermissionForMember(memberId); - if (PermissionLevelCompare.lte(PermissionLevel.Write, permission)) { + console.log(permission, PermissionLevelCompare.lte(PermissionLevel.Write, permission)); + if (PermissionLevel.Admin === permission) { return res(ctx.status(403), ctx.json({ message: 'member can not admin' })); } @@ -219,6 +220,7 @@ export const buildMSWMocks = ( async (req, res, ctx) => { const { id } = req.params; + // todo: check that is admin const body: Pick = await req.json(); const appSetting: Partial = { updatedAt: new Date(),