mirror of
https://github.com/roleypoly/roleypoly.git
synced 2025-06-16 09:39:09 +00:00
feat: add access control
This commit is contained in:
parent
9c07ff0e54
commit
3f45153b66
47 changed files with 1084 additions and 164 deletions
|
@ -8,12 +8,15 @@ export const missingParameters = () =>
|
|||
export const lowPermissions = () =>
|
||||
respond({ error: 'no permissions for this action' }, { status: 403 });
|
||||
|
||||
export const accessControlViolation = () =>
|
||||
respond({ error: 'member fails access control requirements' }, { status: 403 });
|
||||
|
||||
export const notFound = () => respond({ error: 'not found' }, { status: 404 });
|
||||
|
||||
export const conflict = () => respond({ error: 'conflict' }, { status: 409 });
|
||||
|
||||
export const rateLimited = () =>
|
||||
respond({ error: 'rate limit hit, enhance your calm' }, { status: 419 });
|
||||
respond({ error: 'rate limit hit, enhance your calm' }, { status: 429 });
|
||||
|
||||
export const invalid = (obj: any = {}) =>
|
||||
respond({ err: 'client sent something invalid', data: obj }, { status: 400 });
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue