Files
bigcapital/packages/server/src/modules/Roles/models/RolePermission.model.ts
2025-04-07 11:51:24 +02:00

37 lines
677 B
TypeScript

import { Model, mixin } from 'objection';
import { TenantBaseModel } from '@/modules/System/models/TenantBaseModel';
export class RolePermission extends TenantBaseModel {
value: any;
ability: any;
subject: any;
/**
* Table name
*/
static get tableName() {
return 'role_permissions';
}
/**
* Relationship mapping.
*/
static get relationMappings() {
const { Role } = require('./Role.model');
return {
/**
*
*/
role: {
relation: Model.BelongsToOneRelation,
modelClass: Role,
join: {
from: 'role_permissions.roleId',
to: 'roles.id',
},
},
};
}
}