Files
directus/api/src/exceptions/forbidden.ts
rijkvanzanten 35074d1285 Update docs
2020-10-05 12:18:18 -04:00

16 lines
426 B
TypeScript

import { BaseException } from './base';
import { Permission } from '../types';
type Extensions = {
field?: string;
collection?: string;
item?: string | number | (string | number)[];
action?: Permission['action'];
};
export class ForbiddenException extends BaseException {
constructor(message = `You don't have permission to access this.`, extensions?: Extensions) {
super(message, 403, 'FORBIDDEN', extensions);
}
}