F
Filament2mo ago
Akki

Role based access

Hello guys', im new to filament so please bare with me, I need to create an app, say School Management System, where we have 3 roles : admin, teacher and students, each role has login access, student can submit the assignment, teacher can access it, and Admin can manage this two roles and other things. My concern is how to manage 3 roles , do i have to create 3 diffrent panels or i can manage with single panel based on role?
5 Replies
tricia.c
tricia.c2mo ago
You could do it either way. This video by @PovilasKorop may help you decide which would work best for you:
tricia.c
tricia.c2mo ago
Filament Daily
YouTube
Filament Roles: Single vs Multiple Panels Example
A 2-in-1 example of implementing roles: in the same panel or in separate panels? Also, building a common login form or not? - Source for single panel: https://filamentexamples.com/project/filament-roles-in-sign-up-and-different-resources - Source for multiple panels: https://filamentexamples.com/project/filament-roles-with-multiple-panels - Ori...
TegarJK
TegarJK2mo ago
im confused as well,
Bruno Pereira
Bruno Pereira2mo ago
You can go 2 ways. Multi panel or single panel. Either one requires that the canAccessPanel on User model has the right conditions based on the role. The multi panel is less confusing because you don't have to fiddle with the visibility of the resources and/or resource actions such as (create/edit/etc.)
Matthew
Matthew2mo ago
Depends how much granularity you want. One thing is certain, splitting a single panel out to 3 later will be harder than starting off with three.
Want results from more Discord servers?
Add your server