From 35f121ec4a052e18310a5249a3399999102562ae Mon Sep 17 00:00:00 2001 From: Laura Beatris <48022589+LauraBeatris@users.noreply.github.com> Date: Thu, 19 Dec 2024 14:32:42 -0300 Subject: [PATCH] Extract system permission prefix to a separate type --- packages/types/src/organizationMembership.ts | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/packages/types/src/organizationMembership.ts b/packages/types/src/organizationMembership.ts index 8a010d1991..3fad5b8a70 100644 --- a/packages/types/src/organizationMembership.ts +++ b/packages/types/src/organizationMembership.ts @@ -68,13 +68,15 @@ export type OrganizationCustomRoleKey = ClerkAuthorization extends Placeholder : Base['role'] : Base['role']; +export type OrganizationSystemPermissionPrefix = 'org:sys_'; + export type OrganizationSystemPermissionKey = - | 'org:sys_domains:manage' - | 'org:sys_profile:manage' - | 'org:sys_profile:delete' - | 'org:sys_memberships:read' - | 'org:sys_memberships:manage' - | 'org:sys_domains:read'; + | `${OrganizationSystemPermissionPrefix}domains:manage` + | `${OrganizationSystemPermissionPrefix}profile:manage` + | `${OrganizationSystemPermissionPrefix}profile:delete` + | `${OrganizationSystemPermissionPrefix}memberships:read` + | `${OrganizationSystemPermissionPrefix}memberships:manage` + | `${OrganizationSystemPermissionPrefix}domains:read`; /** * OrganizationPermissionKey is a combination of system and custom permissions.