0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2024-12-16 20:26:19 -05:00

Merge pull request #5079 from logto-io/gao-add-enums

This commit is contained in:
Gao Sun 2023-12-11 09:10:25 +08:00 committed by GitHub
commit a066e360f8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 34 additions and 2 deletions

View file

@ -0,0 +1,5 @@
---
"@logto/schemas": minor
---
add tenant role enum and scope enum

View file

@ -1,8 +1,35 @@
export enum TenantTag {
/* Development tenants are free to use but are not meant to be used as production environment */
/* Development tenants are free to use but are not meant to be used as production environment. */
Development = 'development',
/* @deprecated */
Staging = 'staging',
/* A production tenant must have an associated subscription plan, even if it's a free plan */
/* A production tenant must have an associated subscription plan, even if it's a free plan. */
Production = 'production',
}
/** Tenant roles that are used in organization template of admin tenant. */
export enum TenantRole {
/* A tenant admin can manage all resources in the tenant. */
Admin = 'admin',
/* A tenant member can manage resources without deleting them. */
Member = 'member',
}
/** Tenant scopes that are used in organization template of admin tenant. */
export enum TenantScope {
/** Read tenant data. */
ReadTenant = 'read:tenant',
/** Create or update tenant data. */
WriteTenant = 'write:tenant',
/** Delete tenant data. */
DeleteTenant = 'delete:tenant',
/** Invite a new member to the tenant. */
InviteMember = 'invite:member',
/** Remove a member from the tenant. */
RemoveMember = 'remove:member',
/** Update a member's role in the tenant. */
UpdateMemberRole = 'update:member:role',
}
/** The prefix that applies to all organization IDs that are created to represent a tenant. */
export const tenantOrganizationIdPrefix = 't-';