update
This commit is contained in:
@@ -7,6 +7,7 @@ import type { ManyToMany } from '@adonisjs/lucid/types/relations'
|
||||
import { DateTime } from 'luxon'
|
||||
import Role from '#base_modules/Role/model/role'
|
||||
import Permission from '#base_modules/Permission/model/permission'
|
||||
import Tenant from '#base_modules/Tenant/model/tenant'
|
||||
|
||||
const AuthFinder = withAuthFinder(() => hash.use('scrypt'), {
|
||||
uids: ['email'],
|
||||
@@ -52,6 +53,13 @@ export default class Admins extends ComposedModel {
|
||||
})
|
||||
declare roles: ManyToMany<typeof Role>
|
||||
|
||||
@manyToMany(() => Tenant, {
|
||||
pivotTable: 'admin_tenants',
|
||||
pivotForeignKey: 'admin_id',
|
||||
pivotRelatedForeignKey: 'tenant_id',
|
||||
})
|
||||
declare tenants: ManyToMany<typeof Tenant>
|
||||
|
||||
declare permissions: Permission[]
|
||||
|
||||
static accessTokens = DbAccessTokensProvider.forModel(Admins)
|
||||
|
||||
Reference in New Issue
Block a user