In a nested container, we cannot set permissions according to its parent object
I have an object relating to another one, say an event inside an action group. I need to give permissions on the event to anyone who is a member of the action group.
The problem is that in the custom permission class, the method don't have access to the object on which they're applied. has_permission is called without passing the event object. Hence there's no way to know if the user is a member of the action group of the event.
Is there a way to make a custom permission class for that? Or is an agent the only solution?
Edited by Sylvain Le Bon