Nested resources & policies

Hello folks! What a wonderful framework! I'm quite new to Filament so I'm sorry if this has been asked before, I've read the documentation dozens of times and done my due diligence on Google as well as asking the lying machines, I can't figure this out. I have an organisation which has many API keys. Inside my API key policy "create" I am trying to establish what the organisation is which the user is trying to create the API key for - they need to have a role on the org to be allowed to create keys. Is there any way to access the parent/owner resource from within policies - specifically in "create" where my API key instance isn't available yet? Or am I approaching this wrong? What I've already tried - Use {organisation} from the route, this works in some tests - Use {record} from the route, this works in some tests - Use the referer, this works outside the test suite These all feel like a bodge though. Thank you
0 Replies
No replies yetBe the first to reply to this messageJoin

Did you find this page helpful?