feat: introduce role based access control
This commit is contained in:
24
packages/backend/src/models/permission.ts
Normal file
24
packages/backend/src/models/permission.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
import Base from './base';
|
||||
|
||||
class Permission extends Base {
|
||||
id: string;
|
||||
action: string;
|
||||
subject: string;
|
||||
|
||||
static tableName = 'permissions';
|
||||
|
||||
static jsonSchema = {
|
||||
type: 'object',
|
||||
required: ['action', 'subject'],
|
||||
|
||||
properties: {
|
||||
id: { type: 'string', format: 'uuid' },
|
||||
action: { type: 'string', minLength: 1 },
|
||||
subject: { type: 'string', minLength: 1 },
|
||||
createdAt: { type: 'string' },
|
||||
updatedAt: { type: 'string' },
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
export default Permission;
|
||||
Reference in New Issue
Block a user