Implementation
First, define roles on the target resource. Then, add an “invite” permission to control which users can share the resource with others.- Authorization check: Verify the user has the
invite
permission on the resource - Grant access: Insert a
has_role
fact to assign the appropriate role to the invited user
- Check:
authorize(alice, "invite", repository)
- Grant: Insert
has_role(bob, "reader", repository)