shy-exabyte-45922
05/01/2023, 11:32 PMimport { Namespace, Context } from "@ory/keto-namespace-types"
class User implements Namespace {}
class Workspace implements Namespace {
related: {
owners: User[]
editors: User[]
viewers: User[]
}
}
class Organization implements Namespace {
related: {
owners: User[]
editors: User[]
viewers: User[]
parents: Workspace[]
}
}
An Organization can be in one or more workspaces, and if the user is the owner of the Workspace (explicit) he will be the owner of the Organization (implicit).
Example:
User:user1 is in owners of Organization:org1
Workspace:ws1 is in parents of Organization:org1
User:user2 is in owners of Workspace:ws1
User 1 and 2 are owners of org1.
I believe an image will be better to understand ...
1. Detalle de usuário: user details page
2. Detalle de la organizacion: organization details page
3. Detalle ell ambient: workspace details pageshy-exabyte-45922
05/02/2023, 11:30 AMshy-exabyte-45922
05/05/2023, 1:31 AMmagnificent-energy-493
shy-exabyte-45922
05/05/2023, 12:08 PMUser:user1 is in owners of Organization:org1
User:user2 is in owners of Organization:org2
Workspace:ws1 is in parents of Organization:org1
Workspace:ws2 is in parents of Organization:org2
Workspace:ws3 is in parents of Organization:org3
User:user1 is in owners of Workspace:ws3
1. List the resources and roles that a user has access
a. user1:
i. Organization:org1-> owner. (explicit)
ii. Workspace:ws3 -> owner (explicit)
iii. Organization:org3 -> owner (implicit)
b. user2:
i. Organization:org2-> owner. (explicit)
2. List the users and roles that have access to a specific resource
a. org1:
i. User:user1 -> owner (explicit)
b. org2:
i. User:user2 -> owner (explicit)
c. org3:
i. User:user1 -> owner (implicit)