Courses

Vue.js 3 + Laravel 9 SPA: CRUD with Auth

Permissions, Roles and Gates: Securing the Back-End

Previous: Show User Data and Logout
avatar

Hi i have been able to replicate this in my project however i am using a template which does casl with json and i am wondering how to get the same implemented with ability builder / json :

currently the project has these :

import type { AbilityClass } from '@casl/ability' import { Ability } from '@casl/ability'

export type Actions = 'create' | 'read' | 'update' | 'delete' | 'manage'

export type Subjects = 'Auth' | 'Admin' | 'AclDemo' | 'all'

export type AppAbility = Ability<[Actions, Subjects]>

// eslint-disable-next-line @typescript-eslint/no-redeclare export const AppAbility = Ability as AbilityClass<AppAbility>

export interface UserAbility { action: Actions subject: Subjects }

how do i have the ability builder have the actions and subjects according to the permissions 

please advise 

regards
rahul
avatar

Sorry I don't have a quick answer for you, this would require debugging your personal situation, unfortunately I don't have available time for this.

avatar
You can use Markdown
avatar
You can use Markdown