Vanui
AEAsh Elixir
•Created by Vanui on 1/22/2023 in #support
How to use arguments in policies
I have a
rooms has_many members
situation in which I want to authorize joining a room if the user has its invite code, but I can't seem to make it work, even after repeatedly reading through the docs, example apps and source code.
The room resource looks like this:
The member resource authorizes everything:
This is what I get when trying to join a room: (message is too long, see attachment)
I'm not sure why it first says Successful authorization and then forbidden. I'm not sure if I'm missing something to make the argument available to the policy, or if I should be using validations instead, or something completely different.
Thanks in advance4 replies