on-internet
← Community

CASL - Vue 3 - Element not showing for role

Stack Overflow ·

I am having a bit of a challenge implementing CASL in my app. I have created the following composable useAppAbility ("hook") that defines all the rules: import { AbilityBuilder, createMongoAbility, subject } from "@casl/ability"; import { useAbility } from "@casl/vue"; const service = {}; const user = {}; const subscription = {}; const invoice = {}; const account = {}; const ability = createMongoAbility(); const ROLES = ["admin", "account_owner", "beneficiary", "super_admin"]; const defineAbilityFor = (role: Object) => { const { can, rules } = new AbilityBuilder(createMongoAbility); const is =

Comments

Sign in or sign up to comment and upvote.

No comments yet.