Authorization
Gates
Registering Gates
from masonite.facades import Gate
class MyAppProvider(Provider):
def boot(self):
Gate.define("create-post", lambda user: user.is_admin)
Gate.define("update-post", lambda user, post: post.user_id == user.id)Gate.has("create-post")Authorizing Actions
Via the User Model
With a given user
Gate Hooks
Policies
Creating Policies
Registering Policies
Authorizing Actions
Last updated