How do I filter data by permission
I have a table of Orders.
So i have OrderResource but how do i filter the order based on type.
For example, my roles
wheelchair
should only be able to see the Order type wheelchair
while admin
is able to see everything
Thanks in advance :(8 Replies
you should modify the query based on the users role
Using the table function right? Does Policy work the same? I think i poked around it seems filament reflects it on the policy too
policies restrict access to the page. to need to modify query
https://discord.com/channels/883083792112300104/1229129156361588958
could use search for similar topics
ahh okay thanks!
Sorry quick question.
I have the following code now
I tried debugging it. It seems to know to go to the
return null
portion but for some reason it still returns the entire table (i.e return $query
)Because you only modify the portion of the query
okay so must i do like
$query = null
then return $query;?
No. You need to modify the whole query. But I don't think it can be null
Ahh okay... It's okay i'll just return a query that always return false