broad-printer-45521
11/21/2022, 12:03 PMclass User implements Namespace {
related: {}
}
class Group implements Namespace {
related: {
parents: Group[]
members: User[]
}
permits = {
permissionMember: (ctx: Context): boolean => this.related.members.includes(ctx.subject) ||
this.related.parents.traverse( (p) => p.permits.permissionMember(ctx))
}
}
class Permission implements Namespace {
related: {
//groups: SubjectSet<Group, 'effectiveMember'>[]
permissions: Group[]
}
permits = {
allowedFor: (ctx: Context): boolean => this.related.permissions.traverse( (p) => p.permits.permissionMember(ctx))
}
}
RelationTuples:
Group:SalesAndOperationsPlatformTeam#parents@(Group:SalesAndOperations)
Permission:ReadNameOfProjectGiver#permissions@(Group:SalesAndOperations)
Group:SalesAndOperationsPlatformTeam#members@(User:Bar)
Checks:
// Works:
Group:SalesAndOperationsPlatformTeam#parents@(Group:SalesAndOperations)
Group:SalesAndOperationsPlatformTeam#members@(User:Bar)
Group:SalesAndOperationsPlatformTeam#permissionMember@(User:Bar)
Group:SalesAndOperations#permissionMember@(User:Bar)
// Fails:
Permission:ReadNameOfProjectGiver#allowedFor@(User:Bar)
steep-lamp-91158
Group:SalesAndOperations#parents@(Group:SalesAndOperationsPlatformTeam)
work? Shouldn't it be the other way around? We have some cycle detection that could break there...broad-printer-45521
11/21/2022, 1:01 PMallowed = false
😉 I edited the original Postbroad-printer-45521
11/22/2022, 5:51 AMbroad-printer-45521
11/22/2022, 8:23 AMPermission
class, since Group:SalesAndOperations#permissionMember@(User:Bar)
worksbroad-printer-45521
11/22/2022, 10:55 AMOry is the largest open source community in the world for cloud software application security. We maintain advanced open source security software solving authentication, authorization, access control, application network security, and delegation. Ory implements a variety of industry and best-practice standards including OAuth 2.0 / OAuth 2.1, OpenID Connect, Zero Trust Networking, Google Zanzibar Policy Framework, FIDO2 U2F, WebAuthn, TOTP, and more.
Powered by