Will Thornton
11/29/2024, 3:25 PMgroup definition permission member = direct_member + owner as a subject relation ie. relation test_relation = group#member and grant relationships to the resource using this. Users can be granted member and owner.When using the Expand Permission Tree API, it does not further expand through these subject relations. Is this expected behaviour/is there anything we can do to get around this? We would want to expand through this to find all of the users that have direct_member / owner to the group, as well as any groups etc. as they form a recursive hierarchy
Minimal reproducible example of the behaviour in the threadWill Thornton
11/29/2024, 3:25 PMdefinition resource {
relation test: group#member
permission test_permission = test
}
definition group {
relation parent: group
relation direct_member: user
relation owner: user
permission member = owner + direct_member
}
definition user {
}
With the relations
group:1#direct_member@user:2
resource:1#test@group:1#member
group:1#owner@user:1
When running zed permission expand test_permission resource:1, we get
resource:1->test_permission
└── union
└── resource:1->test
└── group:1->member
Which we would then, to find the users, have to run zed permission expand member group:1 to give
group:1->member
└── union
├── group:1->owner
│ └── user:1
└── group:1->direct_member
└── user:2Will Thornton
11/29/2024, 3:28 PMJoey
11/29/2024, 3:41 PMJoey
11/29/2024, 3:41 PMJoey
11/29/2024, 3:41 PMWill Thornton
11/29/2024, 3:49 PMzed permission check ... --explain - but wanted to know if was possible in a single call rather than first hitting LookupSubjects and then the zed permission check ... --explain command.Joey
11/29/2024, 4:27 PMJoey
11/29/2024, 4:27 PMWill Thornton
11/29/2024, 4:30 PM--explain option workJoey
11/29/2024, 4:36 PMWill Thornton
11/29/2024, 4:47 PM