Level 43
May 2, 2024
1
Level 4
Laravel Jetstream- Roles & Permission
As I understand, Laravel Jetstream has few roles defined in the JetstreamServiceProvider-
* Configure the roles and permissions that are available within the application.
*/
protected function configurePermissions(): void
{
Jetstream::defaultApiTokenPermissions(['read']);
Jetstream::role('admin', 'Administrator', [
'create',
'read',
'update',
'delete',
])->description('Administrator users can perform any action.');
Jetstream::role('editor', 'Editor', [
'read',
'create',
'update',
])->description('Editor users have the ability to read, create, and update.');
}
However, I cannot seem to find how can I assign a role to a team and hence to the team member. There is no field like role or permission even in the database migration.
Let's assume a simple user case like:
Team: Administrator
Roles:
- Super Admin, Permissions: everything:create, everything:read, everything:update, everything:delete
- Admin Staff Permissions: everything:read Users:
- John Superadmin with "Super Admin" role
- John SupportStaff with "Admin Staff" role
How can I use Laravel Jetstream to assign the above roles?
Please or to participate in this conversation.