Skip to content
This repository was archived by the owner on Sep 23, 2026. It is now read-only.
This repository was archived by the owner on Sep 23, 2026. It is now read-only.

need some clarification on the basic example #46

Open

Description

@AlonGvili

in the basic example you wrote

ac.grant('user') // define new or modify existing role. also takes an array.
  .createOwn('video') // equivalent to .createOwn('video', ['*'])
  .deleteOwn('video')
  .readAny('video')
  .grant('admin') // switch to another role without breaking the chain
  .extend('user') // inherit role capabilities. also takes an array
  .updateAny('video', ['title']) // explicitly defined attributes
  .deleteAny('video');

i don't understand what the video string is represent, how you define the resource ?
is it the endpoint url ? , part of the url ? , is it an object ?, this part i really don't understand

Activity

  1. TheNaman047-STXYZ commented on Apr 5, 2022

    @TheNaman047-STXYZ

    'video' can be any literal that represents your resource in your application. It can be a route, controller, function, etc. on which you want to enforce access control.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions