This tutorial explains how Custos Sharing Service can be used to impose fine-grained authorization to protect resources and provide specific permissions for users and groups to access a protected resource.

Use Case (Hirachical group-based authorization)

  Creates an Experiment entity and assign read permission to a particular user group and explicitly to a specific user in another group. Evaluates permissions for each user by validating given permission.   The following diagram depicts the user, group, and permission hierarchy.


According to the diagram, permissions shared with Group A should inherit to members of Group A and Group B. Permissions are shared with Adalee explicitly. So Adalee also should have access but  Abigail should not have access to the resource.


UserHas AccessAccess granted type
AliceTrueThrough group A
AudreyTrueThrough group A
SophiaTrueThrough group B via group A
AbelotaTrueThrough group B via group A
AbigailFalse
AdaleeTrueDirect sharing

Prerequisites

Steps

Source Code


Verify via sample web gateway 

you should be able to see users, groups,  and sharings created through python SDK are synced with the local setup demo gateway.