Skip to content

Guard.authorize() multiple rules #44

Answered by ntgussoni
smashboy asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @smashboy "manage" and "all" are reserved words that match any resource and any ability.

Guard.authorize("update", "user", resolver) is how you should use it, and in the ability file you can either give the user the specific hability can("update", "user") or can("manage", "all") if that's the case.

If a user can("manage", "all") then Guard.authorize will always run the resolver.

I'm not sure if I understand your question correctly, but feel free to provide more examples if this isn't enough.

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@smashboy
Comment options

@ntgussoni
Comment options

@smashboy
Comment options

Answer selected by ntgussoni
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants