@stndrds/schema 1.0.0-alpha.72 → 1.0.0-alpha.74

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,58 @@
1
+ // src/constants/default-roles.ts
2
+ var SYSTEM_RESOURCES = {
3
+ /** User profiles, invitations, roles and permissions management */
4
+ PEOPLE: "people",
5
+ /** Object definitions, attributes, tenant settings and audit logs */
6
+ WORKSPACE: "workspace"
7
+ };
8
+ var ALL_SYSTEM_RESOURCES = [
9
+ SYSTEM_RESOURCES.PEOPLE,
10
+ SYSTEM_RESOURCES.WORKSPACE
11
+ ];
12
+ var SYSTEM_RESOURCE_LABELS = {
13
+ people: "People",
14
+ workspace: "Workspace"
15
+ };
16
+ var DEFAULT_ROLES = {
17
+ /** Full platform access - can manage everything */
18
+ OWNER: "owner",
19
+ /** Standard user - can work with business data and view people */
20
+ MEMBER: "member"
21
+ };
22
+ var DEFAULT_ROLE_LABELS = {
23
+ owner: "Owner",
24
+ member: "Member"
25
+ };
26
+ var DEFAULT_ROLE_DESCRIPTIONS = {
27
+ owner: "Full access to all platform features and data",
28
+ member: "Can view, create, edit and delete business data"
29
+ };
30
+ var ALL_ACTIONS = ["read", "create", "update", "delete"];
31
+ var DEFAULT_ROLE_PERMISSIONS = {
32
+ owner: {
33
+ system: [{ target: "*", actions: ALL_ACTIONS }],
34
+ object: [{ target: "*", actions: ALL_ACTIONS }]
35
+ },
36
+ member: {
37
+ system: [{ target: "people", actions: ["read"] }],
38
+ object: [{ target: "*", actions: ALL_ACTIONS }]
39
+ }
40
+ };
41
+ function isDefaultRole(roleName) {
42
+ return Object.values(DEFAULT_ROLES).includes(roleName);
43
+ }
44
+ function isAdminRole(roleName) {
45
+ return roleName === DEFAULT_ROLES.OWNER;
46
+ }
47
+
48
+ export {
49
+ SYSTEM_RESOURCES,
50
+ ALL_SYSTEM_RESOURCES,
51
+ SYSTEM_RESOURCE_LABELS,
52
+ DEFAULT_ROLES,
53
+ DEFAULT_ROLE_LABELS,
54
+ DEFAULT_ROLE_DESCRIPTIONS,
55
+ DEFAULT_ROLE_PERMISSIONS,
56
+ isDefaultRole,
57
+ isAdminRole
58
+ };
@@ -0,0 +1,58 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});// src/constants/default-roles.ts
2
+ var SYSTEM_RESOURCES = {
3
+ /** User profiles, invitations, roles and permissions management */
4
+ PEOPLE: "people",
5
+ /** Object definitions, attributes, tenant settings and audit logs */
6
+ WORKSPACE: "workspace"
7
+ };
8
+ var ALL_SYSTEM_RESOURCES = [
9
+ SYSTEM_RESOURCES.PEOPLE,
10
+ SYSTEM_RESOURCES.WORKSPACE
11
+ ];
12
+ var SYSTEM_RESOURCE_LABELS = {
13
+ people: "People",
14
+ workspace: "Workspace"
15
+ };
16
+ var DEFAULT_ROLES = {
17
+ /** Full platform access - can manage everything */
18
+ OWNER: "owner",
19
+ /** Standard user - can work with business data and view people */
20
+ MEMBER: "member"
21
+ };
22
+ var DEFAULT_ROLE_LABELS = {
23
+ owner: "Owner",
24
+ member: "Member"
25
+ };
26
+ var DEFAULT_ROLE_DESCRIPTIONS = {
27
+ owner: "Full access to all platform features and data",
28
+ member: "Can view, create, edit and delete business data"
29
+ };
30
+ var ALL_ACTIONS = ["read", "create", "update", "delete"];
31
+ var DEFAULT_ROLE_PERMISSIONS = {
32
+ owner: {
33
+ system: [{ target: "*", actions: ALL_ACTIONS }],
34
+ object: [{ target: "*", actions: ALL_ACTIONS }]
35
+ },
36
+ member: {
37
+ system: [{ target: "people", actions: ["read"] }],
38
+ object: [{ target: "*", actions: ALL_ACTIONS }]
39
+ }
40
+ };
41
+ function isDefaultRole(roleName) {
42
+ return Object.values(DEFAULT_ROLES).includes(roleName);
43
+ }
44
+ function isAdminRole(roleName) {
45
+ return roleName === DEFAULT_ROLES.OWNER;
46
+ }
47
+
48
+
49
+
50
+
51
+
52
+
53
+
54
+
55
+
56
+
57
+
58
+ exports.SYSTEM_RESOURCES = SYSTEM_RESOURCES; exports.ALL_SYSTEM_RESOURCES = ALL_SYSTEM_RESOURCES; exports.SYSTEM_RESOURCE_LABELS = SYSTEM_RESOURCE_LABELS; exports.DEFAULT_ROLES = DEFAULT_ROLES; exports.DEFAULT_ROLE_LABELS = DEFAULT_ROLE_LABELS; exports.DEFAULT_ROLE_DESCRIPTIONS = DEFAULT_ROLE_DESCRIPTIONS; exports.DEFAULT_ROLE_PERMISSIONS = DEFAULT_ROLE_PERMISSIONS; exports.isDefaultRole = isDefaultRole; exports.isAdminRole = isAdminRole;