Customize relationManager authorization
Hello guys,
how can I customize a relationManager authorization?
Use case: I have an event (of an organization) and there are employees assigned to events who can have different permissions. The EventResource has different relations (Attendees, PointOfSales, etc), and I want to control the authorization of these relations, but I need the event id in the Policies.
How could I inject the current ownerRecord to the Policy methods, eg: viewAny($user, Event $event) of edit($user, $attendee, $event)
?
1 Reply
Finally figured out :
Just redefine the can and canViewForRecord functions in my relationManager classes: