Roles
Usage
Here you can create different roles. The admin role can not be deleted. You can disable the access to parts of your app for users with given roles.
Say you have a method in your controller, that should only be accessed by admins and teachers:
If the signed in user does not have any of those roles a 401 (unauthorized action) error will be returned. You can also put this in a Middleware if you want to only grant access to users with certain roles to multiple routes/pages. What if a route should be accessed by any user, but you need to display different content to different roles? Easy. Just do this in your template:
Last updated