feat: Convert model files to JS
This commit is contained in:
22
packages/backend/src/models/permission.js
Normal file
22
packages/backend/src/models/permission.js
Normal file
@@ -0,0 +1,22 @@
|
||||
import Base from './base';
|
||||
|
||||
class Permission extends Base {
|
||||
static tableName = 'permissions';
|
||||
|
||||
static jsonSchema = {
|
||||
type: 'object',
|
||||
required: ['roleId', 'action', 'subject'],
|
||||
|
||||
properties: {
|
||||
id: { type: 'string', format: 'uuid' },
|
||||
roleId: { type: 'string', format: 'uuid' },
|
||||
action: { type: 'string', minLength: 1 },
|
||||
subject: { type: 'string', minLength: 1 },
|
||||
conditions: { type: 'array', items: { type: 'string' } },
|
||||
createdAt: { type: 'string' },
|
||||
updatedAt: { type: 'string' },
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
export default Permission;
|
Reference in New Issue
Block a user