Skip to main content

Black Friday 2025! Only until December 1st: coupon FRIDAY25 for 40% off Yearly/Lifetime membership!

Read more here

Permissions, Roles and Gates: Securing the Back-End

Premium
8:59

The Full Lesson is Only for Premium Members

Want to access all of our courses? (29 h 14 min)

You also get:

54 courses
Premium tutorials
Access to repositories
Private Discord
Get Premium for $129/year or $29/month

Already a member? Login here

Comments & Discussion

RB
rahul barua ✓ Link copied!

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
PK
Povilas Korop ✓ Link copied!

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.