Open kavin404 opened 4 years ago
I have a nuxt application where a user can create custom roles. e.g CustomRoleA , CustomRoleB etc. Is there a way to handle this using vue-kindergarten. Is there a way to generate the perimeters dynamically?
import { Perimeter } from 'vue-kindergarten' export default class BasePerimeter extends Perimeter { isSuperAdmin () { return this.child === 'SuperAdministrator' } isPartyAdmin () { return this.child === 'PartyAdministrator' } isTeamAdmin () { return this.child === 'TeamAdministrator' } isPartyUser () { return this.child === 'PartyUser' } }
import BasePerimeter from './base' export default new BasePerimeter({ purpose: 'user', can: { read: () => true, add () { return this.isSuperAdmin() || this.isPartyAdmin() || this.isTeamAdmin() }, update () { return this.isSuperAdmin() || this.isPartyAdmin() || this.isTeamAdmin() }, allowDelete () { return this.isSuperAdmin() || this.isPartyAdmin() || this.isTeamAdmin() }, changePassword () { return this.isSuperAdmin() || this.isPartyAdmin() || this.isTeamAdmin() } } })
I have a nuxt application where a user can create custom roles. e.g CustomRoleA , CustomRoleB etc. Is there a way to handle this using vue-kindergarten. Is there a way to generate the perimeters dynamically?