Skip to main content

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? (30 h 41 min)

You also get:

55 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.

We'd Love Your Feedback

Tell us what you like or what we can improve

Feel free to share anything you like or dislike about this page or the platform in general.