Last active
May 7, 2021 21:39
-
-
Save ktutnik/24a79e8c65e0b59cce8f6fbae670df64 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
authPolicy() | |
.register("ShopOwner", ctx => { | |
// ctx.user is claims of JWT token | |
// from Authorization request header | |
return ctx.user?.role === "ShopOwner" | |
}) | |
// chain to register another policy | |
.register("Staff", ctx => { | |
return ctx.user?.role === "Staff" | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment