b9fadf82a7
* inital pbac setup * fix tests * docs intro * more docs * add comments in docs * revert pr_todo * update to use action + custom as defaults * use enums * move to change user role + multi check * add beforeEach import * docs: add PERMISSIONS.md documenting team/organization role usages Co-Authored-By: sean@cal.com <sean@cal.com> * docs: add permission string alternatives for helper functions Co-Authored-By: sean@cal.com <sean@cal.com> * feat: enhance permission registry and default role permissions Co-Authored-By: sean@cal.com <sean@cal.com> * add routers * add hooks + rsc. Also adjsuted test to use prismock * make hooks type safe + add some tests * add a permission context - trpc router to populate context * update docs * explore global and default roles member,admin,owner * fix tests * use kysley and abstract uril * tidy up * update trpc to use pbac route in endpoint + distinct on teamId * make transform util * remove role service dependancy from permission check class * checkTeamId fall back to orgId if team is parent * todos * remove manual migrations to launch softly * address feedback * move permission checks to a repo * move role service database calls to repo. improve mocks * update tests to have describe import * fix types * remove router that is not used to pass build --------- Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
24 lines
621 B
TypeScript
24 lines
621 B
TypeScript
/**
|
|
* Default role IDs used in the PBAC system
|
|
* These IDs match the ones created in the migration
|
|
*/
|
|
export const DEFAULT_ROLES = {
|
|
OWNER: "owner_role",
|
|
ADMIN: "admin_role",
|
|
MEMBER: "member_role",
|
|
} as const;
|
|
|
|
/**
|
|
* Type for default role IDs
|
|
*/
|
|
export type DefaultRoleId = (typeof DEFAULT_ROLES)[keyof typeof DEFAULT_ROLES];
|
|
|
|
/**
|
|
* Mapping of default roles to their descriptions
|
|
*/
|
|
export const DEFAULT_ROLE_DESCRIPTIONS = {
|
|
[DEFAULT_ROLES.OWNER]: "pbac_owner_role_description",
|
|
[DEFAULT_ROLES.ADMIN]: "pbac_admin_role_description",
|
|
[DEFAULT_ROLES.MEMBER]: "pbac_member_role_description",
|
|
} as const;
|