broad-printer-45521
11/24/2022, 7:47 AM//import { Namespace, SubjectSet, Context } from "@ory/keto-namespace-types"
class User implements Namespace {
related: {}
}
class Group implements Namespace {
related: {
members: User[]
}
}
class Permission implements Namespace {
related: {
permissions: Group[]
users: SubjectSet<Group, 'members'>[]
}
permits = {
allowed: (ctx: Context): boolean => this.related.users.includes( ctx.subject)
}
}
These RelationTuples exist:
Group:TestGroupAAA#members@(User:Foo)
Group:TestGroupBBB#members@(User:Bar)
Permission:TestPermissionAAA#permissions@(Group:TestGroupAAA)
Permission:TestPermissionBBB#permissions@(Group:TestGroupBBB)
These checks should be allowed but are denied:
Permission:TestPermissionAAA#allowed@(User:Foo)
Permission:TestPermissionBBB#allowed@(User:Bar)
I already tried changing the direction of the existing RelationTuples and the Check with no result.broad-printer-45521
11/24/2022, 9:54 AMPermission:TestPermissionAAA#allowedUsers@(Group:TestGroupAAA#members)
Permission:TestPermissionBBB#allowedUsers@(Group:TestGroupBBB#members)
instead of
Permission:TestPermissionAAA#permissions@(Group:TestGroupAAA)
Permission:TestPermissionBBB#permissions@(Group:TestGroupBBB)
Ory 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