Guidance about the authorization and role management
Hello guys,
I want to know the proper way of developing any app in filament. Started using it, playing around with it and it's fun.
But I want to know the best practices.
Things I want (Requirements)
- I want my app to have an admin and few other roles (which will ultimately have the permissions). So, for that what is the best way. 1. Having few panels or 2. having one panel and then authorizing the resources or something.
- Again admin will see all the listing of the models but the users will see only theirs, maybe can or cant edit based on permissions
- Also from the admin panel I want to create roles with permissions and the users having that permission will see only those resources (so again in this case should I use multi panels or single? if any how will I do that)
- Will shield plugin be useful if I want the above functionality like from one panel I can disable functionality of another panel
So overall what is the best way of doing those?
Solution:Jump to solution
As always it depends. If both admin and user interface are pretty much the same you can keep them in one panel. You can limit create/edit/… via policies
If the interfaces are different in a lot of places then I’d go for separate panels.
If you want to filter records in a table, you need to adjust the table query....
3 Replies
Solution
As always it depends. If both admin and user interface are pretty much the same you can keep them in one panel. You can limit create/edit/… via policies
If the interfaces are different in a lot of places then I’d go for separate panels.
If you want to filter records in a table, you need to adjust the table query.
So far I’ve been using the excellent Shield plugin which uses Spatie Roles and Permissions. Here’s the GitHub repo:
https://github.com/bezhanSalleh/filament-shield
Works like a charm and very configurable👍
GitHub
GitHub - bezhanSalleh/filament-shield: The easiest and most intuiti...
The easiest and most intuitive way to add access management to your Filament Admin Resources, Pages & Widgets through
spatie/laravel-permission
- GitHub - bezhanSalleh/filament-shield: Th...thanks much @slooffmaster