Permissions for specific group of records
Hi,
what would be the best way to give a user permission only to select records that are in a given group. For example: You have a states group that have cities and a user has only access to one state and therefore can only select the cities inside that state.
I know it's not a general question for filament but I'm very new here and don't know all the possibilities and plugins that would be appropriate for this.
Thank you! ❤️
9 Replies
have you used Laravel policies before?
no not really
Time to read up about them 😉
would this be correct?
That appears to be correct at a glance, make sure to map the policy to the model
you mean in AuthServiceProvider?
yeah]
Nice. And how would I use this policy for a select multiple in filament forms?
IT will be automatically applied once you setup the policy