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
invitepermission on the resource - Grant access: Insert a
has_rolefact to assign the appropriate role to the invited user
- Check:
authorize(alice, "invite", repository) - Grant: Insert
has_role(bob, "reader", repository)