@atom8n/permissions 0.45.0
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.
- package/dist/build.tsbuildinfo +1 -0
- package/dist/constants.ee.d.ts +58 -0
- package/dist/constants.ee.js +71 -0
- package/dist/constants.ee.js.map +1 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.js +48 -0
- package/dist/index.js.map +1 -0
- package/dist/public-api-permissions.ee.d.ts +8 -0
- package/dist/public-api-permissions.ee.js +117 -0
- package/dist/public-api-permissions.ee.js.map +1 -0
- package/dist/roles/all-roles.d.ts +3 -0
- package/dist/roles/all-roles.js +56 -0
- package/dist/roles/all-roles.js.map +1 -0
- package/dist/roles/role-maps.ee.d.ts +11 -0
- package/dist/roles/role-maps.ee.js +35 -0
- package/dist/roles/role-maps.ee.js.map +1 -0
- package/dist/roles/scopes/credential-sharing-scopes.ee.d.ts +3 -0
- package/dist/roles/scopes/credential-sharing-scopes.ee.js +12 -0
- package/dist/roles/scopes/credential-sharing-scopes.ee.js.map +1 -0
- package/dist/roles/scopes/global-scopes.ee.d.ts +5 -0
- package/dist/roles/scopes/global-scopes.ee.js +161 -0
- package/dist/roles/scopes/global-scopes.ee.js.map +1 -0
- package/dist/roles/scopes/project-scopes.ee.d.ts +6 -0
- package/dist/roles/scopes/project-scopes.ee.js +130 -0
- package/dist/roles/scopes/project-scopes.ee.js.map +1 -0
- package/dist/roles/scopes/workflow-sharing-scopes.ee.d.ts +3 -0
- package/dist/roles/scopes/workflow-sharing-scopes.ee.js +21 -0
- package/dist/roles/scopes/workflow-sharing-scopes.ee.js.map +1 -0
- package/dist/schemas.ee.d.ts +48 -0
- package/dist/schemas.ee.js +61 -0
- package/dist/schemas.ee.js.map +1 -0
- package/dist/scope-information.d.ts +4 -0
- package/dist/scope-information.js +31 -0
- package/dist/scope-information.js.map +1 -0
- package/dist/types.ee.d.ts +59 -0
- package/dist/types.ee.js +13 -0
- package/dist/types.ee.js.map +1 -0
- package/dist/utilities/combine-scopes.ee.d.ts +2 -0
- package/dist/utilities/combine-scopes.ee.js +16 -0
- package/dist/utilities/combine-scopes.ee.js.map +1 -0
- package/dist/utilities/get-global-scopes.ee.d.ts +2 -0
- package/dist/utilities/get-global-scopes.ee.js +6 -0
- package/dist/utilities/get-global-scopes.ee.js.map +1 -0
- package/dist/utilities/get-resource-permissions.ee.d.ts +10 -0
- package/dist/utilities/get-resource-permissions.ee.js +19 -0
- package/dist/utilities/get-resource-permissions.ee.js.map +1 -0
- package/dist/utilities/get-role-scopes.ee.d.ts +4 -0
- package/dist/utilities/get-role-scopes.ee.js +27 -0
- package/dist/utilities/get-role-scopes.ee.js.map +1 -0
- package/dist/utilities/has-global-scope.ee.d.ts +2 -0
- package/dist/utilities/has-global-scope.ee.js +11 -0
- package/dist/utilities/has-global-scope.ee.js.map +1 -0
- package/dist/utilities/has-scope.ee.d.ts +2 -0
- package/dist/utilities/has-scope.ee.js +14 -0
- package/dist/utilities/has-scope.ee.js.map +1 -0
- package/dist/utilities/static-roles-with-scope.ee.d.ts +2 -0
- package/dist/utilities/static-roles-with-scope.ee.js +13 -0
- package/dist/utilities/static-roles-with-scope.ee.js.map +1 -0
- package/package.json +30 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"credential-sharing-scopes.ee.js","sourceRoot":"","sources":["../../../src/roles/scopes/credential-sharing-scopes.ee.ts"],"names":[],"mappings":";;;AAEa,QAAA,gCAAgC,GAAY;IACxD,iBAAiB;IACjB,mBAAmB;IACnB,mBAAmB;IACnB,kBAAkB;IAClB,iBAAiB;CACjB,CAAC;AAEW,QAAA,+BAA+B,GAAY,CAAC,iBAAiB,CAAC,CAAC"}
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GLOBAL_CHAT_USER_SCOPES = exports.GLOBAL_MEMBER_SCOPES = exports.GLOBAL_ADMIN_SCOPES = exports.GLOBAL_OWNER_SCOPES = void 0;
|
|
4
|
+
exports.GLOBAL_OWNER_SCOPES = [
|
|
5
|
+
'annotationTag:create',
|
|
6
|
+
'annotationTag:read',
|
|
7
|
+
'annotationTag:update',
|
|
8
|
+
'annotationTag:delete',
|
|
9
|
+
'annotationTag:list',
|
|
10
|
+
'auditLogs:manage',
|
|
11
|
+
'banner:dismiss',
|
|
12
|
+
'credential:create',
|
|
13
|
+
'credential:read',
|
|
14
|
+
'credential:update',
|
|
15
|
+
'credential:delete',
|
|
16
|
+
'credential:list',
|
|
17
|
+
'credential:share',
|
|
18
|
+
'credential:shareGlobally',
|
|
19
|
+
'credential:move',
|
|
20
|
+
'community:register',
|
|
21
|
+
'communityPackage:install',
|
|
22
|
+
'communityPackage:uninstall',
|
|
23
|
+
'communityPackage:update',
|
|
24
|
+
'communityPackage:list',
|
|
25
|
+
'eventBusDestination:create',
|
|
26
|
+
'eventBusDestination:read',
|
|
27
|
+
'eventBusDestination:update',
|
|
28
|
+
'eventBusDestination:delete',
|
|
29
|
+
'eventBusDestination:list',
|
|
30
|
+
'eventBusDestination:test',
|
|
31
|
+
'externalSecretsProvider:create',
|
|
32
|
+
'externalSecretsProvider:read',
|
|
33
|
+
'externalSecretsProvider:update',
|
|
34
|
+
'externalSecretsProvider:delete',
|
|
35
|
+
'externalSecretsProvider:list',
|
|
36
|
+
'externalSecretsProvider:sync',
|
|
37
|
+
'externalSecret:list',
|
|
38
|
+
'externalSecret:use',
|
|
39
|
+
'ldap:manage',
|
|
40
|
+
'ldap:sync',
|
|
41
|
+
'license:manage',
|
|
42
|
+
'logStreaming:manage',
|
|
43
|
+
'orchestration:read',
|
|
44
|
+
'saml:manage',
|
|
45
|
+
'securityAudit:generate',
|
|
46
|
+
'sourceControl:pull',
|
|
47
|
+
'sourceControl:push',
|
|
48
|
+
'sourceControl:manage',
|
|
49
|
+
'tag:create',
|
|
50
|
+
'tag:read',
|
|
51
|
+
'tag:update',
|
|
52
|
+
'tag:delete',
|
|
53
|
+
'tag:list',
|
|
54
|
+
'user:create',
|
|
55
|
+
'user:read',
|
|
56
|
+
'user:update',
|
|
57
|
+
'user:delete',
|
|
58
|
+
'user:list',
|
|
59
|
+
'user:resetPassword',
|
|
60
|
+
'user:changeRole',
|
|
61
|
+
'user:enforceMfa',
|
|
62
|
+
'variable:create',
|
|
63
|
+
'variable:read',
|
|
64
|
+
'variable:update',
|
|
65
|
+
'variable:delete',
|
|
66
|
+
'variable:list',
|
|
67
|
+
'projectVariable:create',
|
|
68
|
+
'projectVariable:read',
|
|
69
|
+
'projectVariable:update',
|
|
70
|
+
'projectVariable:delete',
|
|
71
|
+
'projectVariable:list',
|
|
72
|
+
'workflow:create',
|
|
73
|
+
'workflow:read',
|
|
74
|
+
'workflow:update',
|
|
75
|
+
'workflow:publish',
|
|
76
|
+
'workflow:delete',
|
|
77
|
+
'workflow:list',
|
|
78
|
+
'workflow:share',
|
|
79
|
+
'workflow:execute',
|
|
80
|
+
'workflow:execute-chat',
|
|
81
|
+
'workflow:move',
|
|
82
|
+
'workersView:manage',
|
|
83
|
+
'project:list',
|
|
84
|
+
'project:create',
|
|
85
|
+
'project:read',
|
|
86
|
+
'project:update',
|
|
87
|
+
'project:delete',
|
|
88
|
+
'insights:list',
|
|
89
|
+
'folder:move',
|
|
90
|
+
'folder:read',
|
|
91
|
+
'folder:update',
|
|
92
|
+
'folder:delete',
|
|
93
|
+
'folder:create',
|
|
94
|
+
'folder:list',
|
|
95
|
+
'oidc:manage',
|
|
96
|
+
'provisioning:manage',
|
|
97
|
+
'dataTable:create',
|
|
98
|
+
'dataTable:delete',
|
|
99
|
+
'dataTable:read',
|
|
100
|
+
'dataTable:update',
|
|
101
|
+
'dataTable:list',
|
|
102
|
+
'dataTable:listProject',
|
|
103
|
+
'dataTable:readRow',
|
|
104
|
+
'dataTable:writeRow',
|
|
105
|
+
'role:manage',
|
|
106
|
+
'mcp:manage',
|
|
107
|
+
'mcp:oauth',
|
|
108
|
+
'mcpApiKey:create',
|
|
109
|
+
'mcpApiKey:rotate',
|
|
110
|
+
'chatHub:manage',
|
|
111
|
+
'chatHub:message',
|
|
112
|
+
'chatHubAgent:create',
|
|
113
|
+
'chatHubAgent:read',
|
|
114
|
+
'chatHubAgent:update',
|
|
115
|
+
'chatHubAgent:delete',
|
|
116
|
+
'chatHubAgent:list',
|
|
117
|
+
'breakingChanges:list',
|
|
118
|
+
'apiKey:manage',
|
|
119
|
+
'credentialResolver:create',
|
|
120
|
+
'credentialResolver:read',
|
|
121
|
+
'credentialResolver:update',
|
|
122
|
+
'credentialResolver:delete',
|
|
123
|
+
'credentialResolver:list',
|
|
124
|
+
];
|
|
125
|
+
exports.GLOBAL_ADMIN_SCOPES = exports.GLOBAL_OWNER_SCOPES.concat();
|
|
126
|
+
exports.GLOBAL_MEMBER_SCOPES = [
|
|
127
|
+
'annotationTag:create',
|
|
128
|
+
'annotationTag:read',
|
|
129
|
+
'annotationTag:update',
|
|
130
|
+
'annotationTag:delete',
|
|
131
|
+
'annotationTag:list',
|
|
132
|
+
'eventBusDestination:list',
|
|
133
|
+
'eventBusDestination:test',
|
|
134
|
+
'tag:create',
|
|
135
|
+
'tag:read',
|
|
136
|
+
'tag:update',
|
|
137
|
+
'tag:list',
|
|
138
|
+
'user:list',
|
|
139
|
+
'variable:list',
|
|
140
|
+
'variable:read',
|
|
141
|
+
'dataTable:list',
|
|
142
|
+
'mcp:oauth',
|
|
143
|
+
'mcpApiKey:create',
|
|
144
|
+
'mcpApiKey:rotate',
|
|
145
|
+
'chatHub:message',
|
|
146
|
+
'chatHubAgent:create',
|
|
147
|
+
'chatHubAgent:read',
|
|
148
|
+
'chatHubAgent:update',
|
|
149
|
+
'chatHubAgent:delete',
|
|
150
|
+
'chatHubAgent:list',
|
|
151
|
+
'apiKey:manage',
|
|
152
|
+
];
|
|
153
|
+
exports.GLOBAL_CHAT_USER_SCOPES = [
|
|
154
|
+
'chatHub:message',
|
|
155
|
+
'chatHubAgent:create',
|
|
156
|
+
'chatHubAgent:read',
|
|
157
|
+
'chatHubAgent:update',
|
|
158
|
+
'chatHubAgent:delete',
|
|
159
|
+
'chatHubAgent:list',
|
|
160
|
+
];
|
|
161
|
+
//# sourceMappingURL=global-scopes.ee.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"global-scopes.ee.js","sourceRoot":"","sources":["../../../src/roles/scopes/global-scopes.ee.ts"],"names":[],"mappings":";;;AAEa,QAAA,mBAAmB,GAAY;IAC3C,sBAAsB;IACtB,oBAAoB;IACpB,sBAAsB;IACtB,sBAAsB;IACtB,oBAAoB;IACpB,kBAAkB;IAClB,gBAAgB;IAChB,mBAAmB;IACnB,iBAAiB;IACjB,mBAAmB;IACnB,mBAAmB;IACnB,iBAAiB;IACjB,kBAAkB;IAClB,0BAA0B;IAC1B,iBAAiB;IACjB,oBAAoB;IACpB,0BAA0B;IAC1B,4BAA4B;IAC5B,yBAAyB;IACzB,uBAAuB;IACvB,4BAA4B;IAC5B,0BAA0B;IAC1B,4BAA4B;IAC5B,4BAA4B;IAC5B,0BAA0B;IAC1B,0BAA0B;IAC1B,gCAAgC;IAChC,8BAA8B;IAC9B,gCAAgC;IAChC,gCAAgC;IAChC,8BAA8B;IAC9B,8BAA8B;IAC9B,qBAAqB;IACrB,oBAAoB;IACpB,aAAa;IACb,WAAW;IACX,gBAAgB;IAChB,qBAAqB;IACrB,oBAAoB;IACpB,aAAa;IACb,wBAAwB;IACxB,oBAAoB;IACpB,oBAAoB;IACpB,sBAAsB;IACtB,YAAY;IACZ,UAAU;IACV,YAAY;IACZ,YAAY;IACZ,UAAU;IACV,aAAa;IACb,WAAW;IACX,aAAa;IACb,aAAa;IACb,WAAW;IACX,oBAAoB;IACpB,iBAAiB;IACjB,iBAAiB;IACjB,iBAAiB;IACjB,eAAe;IACf,iBAAiB;IACjB,iBAAiB;IACjB,eAAe;IACf,wBAAwB;IACxB,sBAAsB;IACtB,wBAAwB;IACxB,wBAAwB;IACxB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B;IACrB,qBAAqB;IACrB,mBAAmB;CACnB,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { Scope } from '../../types.ee';
|
|
2
|
+
export declare const REGULAR_PROJECT_ADMIN_SCOPES: Scope[];
|
|
3
|
+
export declare const PERSONAL_PROJECT_OWNER_SCOPES: Scope[];
|
|
4
|
+
export declare const PROJECT_EDITOR_SCOPES: Scope[];
|
|
5
|
+
export declare const PROJECT_VIEWER_SCOPES: Scope[];
|
|
6
|
+
export declare const PROJECT_CHAT_USER_SCOPES: Scope[];
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PROJECT_CHAT_USER_SCOPES = exports.PROJECT_VIEWER_SCOPES = exports.PROJECT_EDITOR_SCOPES = exports.PERSONAL_PROJECT_OWNER_SCOPES = exports.REGULAR_PROJECT_ADMIN_SCOPES = void 0;
|
|
4
|
+
exports.REGULAR_PROJECT_ADMIN_SCOPES = [
|
|
5
|
+
'workflow:create',
|
|
6
|
+
'workflow:read',
|
|
7
|
+
'workflow:update',
|
|
8
|
+
'workflow:publish',
|
|
9
|
+
'workflow:delete',
|
|
10
|
+
'workflow:list',
|
|
11
|
+
'workflow:execute',
|
|
12
|
+
'workflow:execute-chat',
|
|
13
|
+
'workflow:move',
|
|
14
|
+
'credential:create',
|
|
15
|
+
'credential:read',
|
|
16
|
+
'credential:update',
|
|
17
|
+
'credential:delete',
|
|
18
|
+
'credential:list',
|
|
19
|
+
'credential:move',
|
|
20
|
+
'credential:share',
|
|
21
|
+
'project:list',
|
|
22
|
+
'project:read',
|
|
23
|
+
'project:update',
|
|
24
|
+
'project:delete',
|
|
25
|
+
'folder:create',
|
|
26
|
+
'folder:read',
|
|
27
|
+
'folder:update',
|
|
28
|
+
'folder:delete',
|
|
29
|
+
'folder:list',
|
|
30
|
+
'folder:move',
|
|
31
|
+
'sourceControl:push',
|
|
32
|
+
'dataTable:create',
|
|
33
|
+
'dataTable:delete',
|
|
34
|
+
'dataTable:read',
|
|
35
|
+
'dataTable:update',
|
|
36
|
+
'dataTable:listProject',
|
|
37
|
+
'dataTable:readRow',
|
|
38
|
+
'dataTable:writeRow',
|
|
39
|
+
'projectVariable:list',
|
|
40
|
+
'projectVariable:read',
|
|
41
|
+
'projectVariable:create',
|
|
42
|
+
'projectVariable:update',
|
|
43
|
+
'projectVariable:delete',
|
|
44
|
+
];
|
|
45
|
+
exports.PERSONAL_PROJECT_OWNER_SCOPES = [
|
|
46
|
+
'workflow:create',
|
|
47
|
+
'workflow:read',
|
|
48
|
+
'workflow:update',
|
|
49
|
+
'workflow:publish',
|
|
50
|
+
'workflow:delete',
|
|
51
|
+
'workflow:list',
|
|
52
|
+
'workflow:execute',
|
|
53
|
+
'workflow:execute-chat',
|
|
54
|
+
'workflow:share',
|
|
55
|
+
'workflow:move',
|
|
56
|
+
'credential:create',
|
|
57
|
+
'credential:read',
|
|
58
|
+
'credential:update',
|
|
59
|
+
'credential:delete',
|
|
60
|
+
'credential:list',
|
|
61
|
+
'credential:share',
|
|
62
|
+
'credential:move',
|
|
63
|
+
'project:list',
|
|
64
|
+
'project:read',
|
|
65
|
+
'folder:create',
|
|
66
|
+
'folder:read',
|
|
67
|
+
'folder:update',
|
|
68
|
+
'folder:delete',
|
|
69
|
+
'folder:list',
|
|
70
|
+
'folder:move',
|
|
71
|
+
'dataTable:create',
|
|
72
|
+
'dataTable:delete',
|
|
73
|
+
'dataTable:read',
|
|
74
|
+
'dataTable:update',
|
|
75
|
+
'dataTable:listProject',
|
|
76
|
+
'dataTable:readRow',
|
|
77
|
+
'dataTable:writeRow',
|
|
78
|
+
];
|
|
79
|
+
exports.PROJECT_EDITOR_SCOPES = [
|
|
80
|
+
'workflow:create',
|
|
81
|
+
'workflow:read',
|
|
82
|
+
'workflow:update',
|
|
83
|
+
'workflow:publish',
|
|
84
|
+
'workflow:delete',
|
|
85
|
+
'workflow:list',
|
|
86
|
+
'workflow:execute',
|
|
87
|
+
'workflow:execute-chat',
|
|
88
|
+
'credential:create',
|
|
89
|
+
'credential:read',
|
|
90
|
+
'credential:update',
|
|
91
|
+
'credential:delete',
|
|
92
|
+
'credential:list',
|
|
93
|
+
'project:list',
|
|
94
|
+
'project:read',
|
|
95
|
+
'folder:create',
|
|
96
|
+
'folder:read',
|
|
97
|
+
'folder:update',
|
|
98
|
+
'folder:delete',
|
|
99
|
+
'folder:list',
|
|
100
|
+
'dataTable:create',
|
|
101
|
+
'dataTable:delete',
|
|
102
|
+
'dataTable:read',
|
|
103
|
+
'dataTable:update',
|
|
104
|
+
'dataTable:listProject',
|
|
105
|
+
'dataTable:readRow',
|
|
106
|
+
'dataTable:writeRow',
|
|
107
|
+
'projectVariable:list',
|
|
108
|
+
'projectVariable:read',
|
|
109
|
+
'projectVariable:create',
|
|
110
|
+
'projectVariable:update',
|
|
111
|
+
'projectVariable:delete',
|
|
112
|
+
];
|
|
113
|
+
exports.PROJECT_VIEWER_SCOPES = [
|
|
114
|
+
'credential:list',
|
|
115
|
+
'credential:read',
|
|
116
|
+
'project:list',
|
|
117
|
+
'project:read',
|
|
118
|
+
'workflow:list',
|
|
119
|
+
'workflow:read',
|
|
120
|
+
'workflow:execute-chat',
|
|
121
|
+
'folder:read',
|
|
122
|
+
'folder:list',
|
|
123
|
+
'dataTable:listProject',
|
|
124
|
+
'dataTable:read',
|
|
125
|
+
'dataTable:readRow',
|
|
126
|
+
'projectVariable:list',
|
|
127
|
+
'projectVariable:read',
|
|
128
|
+
];
|
|
129
|
+
exports.PROJECT_CHAT_USER_SCOPES = ['workflow:execute-chat'];
|
|
130
|
+
//# sourceMappingURL=project-scopes.ee.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project-scopes.ee.js","sourceRoot":"","sources":["../../../src/roles/scopes/project-scopes.ee.ts"],"names":[],"mappings":";;;AAQa,QAAA,4BAA4B,GAAY;IACpD,iBAAiB;IACjB,eAA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Ae;IACf,eAAe;IACf,aAAa;IACb,kBAAkB;IAClB,kBAAkB;IAClB,gBAAgB;IAChB,kBAAkB;IAClB,uBAAuB;IACvB,mBAAmB;IACnB,oBAAoB;IACpB,sBAAsB;IACtB,sBAAsB;IACtB,wBAAwB;IACxB,wBAAwB;IACxB,wBAAwB;CACxB,CAAC;AAEW,QAAA,qBAAqB,GAAY;IAC7C,iBAAiB;IACjB,iBAAiB;IACjB,cAAc;IACd,cAAc;IACd,eAAe;IACf,eAAe;IACf,uBAAuB;IACvB,aAAa;IACb,aAAa;IACb,uBAAuB;IACvB,gBAAgB;IAChB,mBAAmB;IACnB,sBAAsB;IACtB,sBAAsB;CACtB,CAAC;AAEW,QAAA,wBAAwB,GAAY,CAAC,uBAAuB,CAAC,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WORKFLOW_SHARING_EDITOR_SCOPES = exports.WORKFLOW_SHARING_OWNER_SCOPES = void 0;
|
|
4
|
+
exports.WORKFLOW_SHARING_OWNER_SCOPES = [
|
|
5
|
+
'workflow:read',
|
|
6
|
+
'workflow:update',
|
|
7
|
+
'workflow:publish',
|
|
8
|
+
'workflow:delete',
|
|
9
|
+
'workflow:execute',
|
|
10
|
+
'workflow:share',
|
|
11
|
+
'workflow:move',
|
|
12
|
+
'workflow:execute-chat',
|
|
13
|
+
];
|
|
14
|
+
exports.WORKFLOW_SHARING_EDITOR_SCOPES = [
|
|
15
|
+
'workflow:read',
|
|
16
|
+
'workflow:update',
|
|
17
|
+
'workflow:publish',
|
|
18
|
+
'workflow:execute',
|
|
19
|
+
'workflow:execute-chat',
|
|
20
|
+
];
|
|
21
|
+
//# sourceMappingURL=workflow-sharing-scopes.ee.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workflow-sharing-scopes.ee.js","sourceRoot":"","sources":["../../../src/roles/scopes/workflow-sharing-scopes.ee.ts"],"names":[],"mappings":";;;AAEa,QAAA,6BAA6B,GAAY;IACrD,eAAe;IACf,iBAAiB;IACjB,kBAAkB;IAClB,iBAAiB;IACjB,kBAAkB;IAClB,gBAAgB;IAChB,eAAe;IACf,uBAAuB;CACvB,CAAC;AAEW,QAAA,8BAA8B,GAAY;IACtD,eAAe;IACf,iBAAiB;IACjB,kBAAkB;IAClB,kBAAkB;IAClB,uBAAuB;CACvB,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const roleNamespaceSchema: z.ZodEnum<["global", "project", "credential", "workflow"]>;
|
|
3
|
+
export declare const globalRoleSchema: z.ZodEnum<["global:owner", "global:admin", "global:member", "global:chatUser"]>;
|
|
4
|
+
export declare const assignableGlobalRoleSchema: z.ZodUnion<[z.ZodEnum<["global:admin", "global:member", "global:chatUser"]>, z.ZodEffects<z.ZodString, string, string>]>;
|
|
5
|
+
export declare const personalRoleSchema: z.ZodEnum<["project:personalOwner"]>;
|
|
6
|
+
export declare const teamRoleSchema: z.ZodEnum<["project:admin", "project:editor", "project:viewer", "project:chatUser"]>;
|
|
7
|
+
export declare const customProjectRoleSchema: z.ZodEffects<z.ZodString, string, string>;
|
|
8
|
+
export declare const systemProjectRoleSchema: z.ZodUnion<[z.ZodEnum<["project:personalOwner"]>, z.ZodEnum<["project:admin", "project:editor", "project:viewer", "project:chatUser"]>]>;
|
|
9
|
+
export declare const assignableProjectRoleSchema: z.ZodUnion<[z.ZodEnum<["project:admin", "project:editor", "project:viewer", "project:chatUser"]>, z.ZodEffects<z.ZodString, string, string>]>;
|
|
10
|
+
export declare const projectRoleSchema: z.ZodUnion<[z.ZodUnion<[z.ZodEnum<["project:personalOwner"]>, z.ZodEnum<["project:admin", "project:editor", "project:viewer", "project:chatUser"]>]>, z.ZodEffects<z.ZodString, string, string>]>;
|
|
11
|
+
export declare const credentialSharingRoleSchema: z.ZodEnum<["credential:owner", "credential:user"]>;
|
|
12
|
+
export declare const workflowSharingRoleSchema: z.ZodEnum<["workflow:owner", "workflow:editor"]>;
|
|
13
|
+
export declare const scopeSchema: z.ZodEffects<z.ZodString, string, string>;
|
|
14
|
+
export declare const roleSchema: z.ZodObject<{
|
|
15
|
+
slug: z.ZodString;
|
|
16
|
+
displayName: z.ZodString;
|
|
17
|
+
description: z.ZodNullable<z.ZodString>;
|
|
18
|
+
systemRole: z.ZodBoolean;
|
|
19
|
+
roleType: z.ZodEnum<["global", "project", "credential", "workflow"]>;
|
|
20
|
+
licensed: z.ZodBoolean;
|
|
21
|
+
scopes: z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">;
|
|
22
|
+
createdAt: z.ZodOptional<z.ZodDate>;
|
|
23
|
+
updatedAt: z.ZodOptional<z.ZodDate>;
|
|
24
|
+
usedByUsers: z.ZodOptional<z.ZodNumber>;
|
|
25
|
+
}, "strip", z.ZodTypeAny, {
|
|
26
|
+
displayName: string;
|
|
27
|
+
description: string | null;
|
|
28
|
+
slug: string;
|
|
29
|
+
systemRole: boolean;
|
|
30
|
+
roleType: "credential" | "project" | "workflow" | "global";
|
|
31
|
+
licensed: boolean;
|
|
32
|
+
scopes: string[];
|
|
33
|
+
createdAt?: Date | undefined;
|
|
34
|
+
updatedAt?: Date | undefined;
|
|
35
|
+
usedByUsers?: number | undefined;
|
|
36
|
+
}, {
|
|
37
|
+
displayName: string;
|
|
38
|
+
description: string | null;
|
|
39
|
+
slug: string;
|
|
40
|
+
systemRole: boolean;
|
|
41
|
+
roleType: "credential" | "project" | "workflow" | "global";
|
|
42
|
+
licensed: boolean;
|
|
43
|
+
scopes: string[];
|
|
44
|
+
createdAt?: Date | undefined;
|
|
45
|
+
updatedAt?: Date | undefined;
|
|
46
|
+
usedByUsers?: number | undefined;
|
|
47
|
+
}>;
|
|
48
|
+
export type Role = z.infer<typeof roleSchema>;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.roleSchema = exports.scopeSchema = exports.workflowSharingRoleSchema = exports.credentialSharingRoleSchema = exports.projectRoleSchema = exports.assignableProjectRoleSchema = exports.systemProjectRoleSchema = exports.customProjectRoleSchema = exports.teamRoleSchema = exports.personalRoleSchema = exports.assignableGlobalRoleSchema = exports.globalRoleSchema = exports.roleNamespaceSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const scope_information_1 = require("./scope-information");
|
|
6
|
+
exports.roleNamespaceSchema = zod_1.z.enum(['global', 'project', 'credential', 'workflow']);
|
|
7
|
+
exports.globalRoleSchema = zod_1.z.enum([
|
|
8
|
+
'global:owner',
|
|
9
|
+
'global:admin',
|
|
10
|
+
'global:member',
|
|
11
|
+
'global:chatUser',
|
|
12
|
+
]);
|
|
13
|
+
const customGlobalRoleSchema = zod_1.z
|
|
14
|
+
.string()
|
|
15
|
+
.nonempty()
|
|
16
|
+
.refine((val) => !exports.globalRoleSchema.safeParse(val).success, {
|
|
17
|
+
message: 'This global role value is not assignable',
|
|
18
|
+
});
|
|
19
|
+
exports.assignableGlobalRoleSchema = zod_1.z.union([
|
|
20
|
+
exports.globalRoleSchema.exclude([
|
|
21
|
+
'global:owner',
|
|
22
|
+
]),
|
|
23
|
+
customGlobalRoleSchema,
|
|
24
|
+
]);
|
|
25
|
+
exports.personalRoleSchema = zod_1.z.enum([
|
|
26
|
+
'project:personalOwner',
|
|
27
|
+
]);
|
|
28
|
+
exports.teamRoleSchema = zod_1.z.enum([
|
|
29
|
+
'project:admin',
|
|
30
|
+
'project:editor',
|
|
31
|
+
'project:viewer',
|
|
32
|
+
'project:chatUser',
|
|
33
|
+
]);
|
|
34
|
+
exports.customProjectRoleSchema = zod_1.z
|
|
35
|
+
.string()
|
|
36
|
+
.nonempty()
|
|
37
|
+
.refine((val) => !exports.systemProjectRoleSchema.safeParse(val).success, {
|
|
38
|
+
message: 'This global role value is not assignable',
|
|
39
|
+
});
|
|
40
|
+
exports.systemProjectRoleSchema = zod_1.z.union([exports.personalRoleSchema, exports.teamRoleSchema]);
|
|
41
|
+
exports.assignableProjectRoleSchema = zod_1.z.union([exports.teamRoleSchema, exports.customProjectRoleSchema]);
|
|
42
|
+
exports.projectRoleSchema = zod_1.z.union([exports.systemProjectRoleSchema, exports.customProjectRoleSchema]);
|
|
43
|
+
exports.credentialSharingRoleSchema = zod_1.z.enum(['credential:owner', 'credential:user']);
|
|
44
|
+
exports.workflowSharingRoleSchema = zod_1.z.enum(['workflow:owner', 'workflow:editor']);
|
|
45
|
+
const ALL_SCOPES_LOOKUP_SET = new Set(scope_information_1.ALL_SCOPES);
|
|
46
|
+
exports.scopeSchema = zod_1.z.string().refine((val) => ALL_SCOPES_LOOKUP_SET.has(val), {
|
|
47
|
+
message: 'Invalid scope',
|
|
48
|
+
});
|
|
49
|
+
exports.roleSchema = zod_1.z.object({
|
|
50
|
+
slug: zod_1.z.string().min(1),
|
|
51
|
+
displayName: zod_1.z.string().min(1),
|
|
52
|
+
description: zod_1.z.string().nullable(),
|
|
53
|
+
systemRole: zod_1.z.boolean(),
|
|
54
|
+
roleType: exports.roleNamespaceSchema,
|
|
55
|
+
licensed: zod_1.z.boolean(),
|
|
56
|
+
scopes: zod_1.z.array(exports.scopeSchema),
|
|
57
|
+
createdAt: zod_1.z.date().optional(),
|
|
58
|
+
updatedAt: zod_1.z.date().optional(),
|
|
59
|
+
usedByUsers: zod_1.z.number().optional(),
|
|
60
|
+
});
|
|
61
|
+
//# sourceMappingURL=schemas.ee.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schemas.ee.js","sourceRoot":"","sources":["../src/schemas.ee.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAExB,2DAAiD;AAEpC,QAAA,mBAAmB,GAAG,OAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,SAAS,EAAE,YAAY,EAAE,UAAU,CAAC,CAAC,CAAC;AAE9E,QAAA,gBAA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AC,kBAAkB,EAAE,iBAAiB,CAAC,CAAC,CAAC;AAE9E,QAAA,yBAAyB,GAAG,OAAC,CAAC,IAAI,CAAC,CAAC,gBAAgB,EAAE,iBAAiB,CAAC,CAAC,CAAC;AAEvF,MAAM,qBAAqB,GAAG,IAAI,GAAG,CAAC,8BAAsB,CAAC,CAAC;AAEjD,QAAA,WAAW,GAAG,OAAC,CAAC,MAAM,EAAE,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,qBAAqB,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE;IACrF,OAAO,EAAE,eAAe;CACxB,CAAC,CAAC;AAEU,QAAA,UAAU,GAAG,OAAC,CAAC,MAAM,CAAC;IAClC,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACvB,WAAW,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC9B,WAAW,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAClC,UAAU,EAAE,OAAC,CAAC,OAAO,EAAE;IACvB,QAAQ,EAAE,2BAAmB;IAC7B,QAAQ,EAAE,OAAC,CAAC,OAAO,EAAE;IACrB,MAAM,EAAE,OAAC,CAAC,KAAK,CAAC,mBAAW,CAAC;IAC5B,SAAS,EAAE,OAAC,CAAC,IAAI,EAAE,CAAC,QAAQ,EAAE;IAC9B,SAAS,EAAE,OAAC,CAAC,IAAI,EAAE,CAAC,QAAQ,EAAE;IAC9B,WAAW,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAClC,CAAC,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.scopeInformation = exports.ALL_API_KEY_SCOPES = exports.ALL_SCOPES = void 0;
|
|
4
|
+
const constants_ee_1 = require("./constants.ee");
|
|
5
|
+
function buildResourceScopes() {
|
|
6
|
+
const resourceScopes = Object.entries(constants_ee_1.RESOURCES).flatMap(([resource, operations]) => [
|
|
7
|
+
...operations.map((op) => `${resource}:${op}`),
|
|
8
|
+
`${resource}:*`,
|
|
9
|
+
]);
|
|
10
|
+
resourceScopes.push('*');
|
|
11
|
+
return resourceScopes;
|
|
12
|
+
}
|
|
13
|
+
function buildApiKeyScopes() {
|
|
14
|
+
const apiKeyScopes = Object.entries(constants_ee_1.API_KEY_RESOURCES).flatMap(([resource, operations]) => [
|
|
15
|
+
...operations.map((op) => `${resource}:${op}`),
|
|
16
|
+
]);
|
|
17
|
+
return new Set(apiKeyScopes);
|
|
18
|
+
}
|
|
19
|
+
exports.ALL_SCOPES = buildResourceScopes();
|
|
20
|
+
exports.ALL_API_KEY_SCOPES = buildApiKeyScopes();
|
|
21
|
+
exports.scopeInformation = {
|
|
22
|
+
'annotationTag:create': {
|
|
23
|
+
displayName: 'Create Annotation Tag',
|
|
24
|
+
description: 'Allows creating new annotation tags.',
|
|
25
|
+
},
|
|
26
|
+
'workflow:publish': {
|
|
27
|
+
displayName: 'Publish Workflow',
|
|
28
|
+
description: 'Allows publishing and unpublishing workflows.',
|
|
29
|
+
},
|
|
30
|
+
};
|
|
31
|
+
//# sourceMappingURL=scope-information.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scope-information.js","sourceRoot":"","sources":["../src/scope-information.ts"],"names":[],"mappings":";;;AAAA,iDAA8D;AAG9D,SAAS,mBAAmB;IAC3B,MAAM,cAAc,GAAG,MAAM,CAAC,OAAO,CAAC,wBAAS,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,QAAQ,EAAE,UAAU,CAAC,EAAE,EAAE,CAAC;QACpF,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,GAAG,QAAQ,IAAI,EAAE,EAAW,CAAC;QACvD,GAAG,QAAQ,IAAa;KACxB,CAAY,CAAC;IAEd,cAAc,CAAC,IAAI,CAAC,GAAY,CAAC,CAAC;IAClC,OAAO,cAAc,CAAC;AACvB,CAAC;AAED,SAAS,iBAAiB;IACzB,MAAM,YAAY,GAAG,MAAM,CAAC,OAAO,CAAC,gCAAiB,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,QAAQ,EAAE,UAAU,CAAC,EAAE,EAAE,CAAC;QAC1F,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,GAAG,QAAQ,IAAI,EAAE,EAAW,CAAC;KACvD,CAAkB,CAAC;IAEpB,OAAO,IAAI,GAAG,CAAC,YAAY,CAAC,CAAC;AAC9B,CAAC;AAEY,QAAA,UAAU,GAAG,mBAAmB,EAAE,CAAC;AAEnC,QAAA,kBAAkB,GAAG,iBAAiB,EAAE,CAAC;AAEzC,QAAA,gBAAgB,GAA6C;IACzE,sBAAsB,EAAE;QACvB,WAAW,EAAE,uBAAuB;QACpC,WAAW,EAAE,sCAAsC;KACnD;IACD,kBAAkB,EAAE;QACnB,WAAW,EAAE,kBAAkB;QAC/B,WAAW,EAAE,+CAA+C;KAC5D;CACD,CAAC"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import type { z } from 'zod';
|
|
2
|
+
import type { RESOURCES, API_KEY_RESOURCES } from './constants.ee';
|
|
3
|
+
import type { assignableGlobalRoleSchema, credentialSharingRoleSchema, globalRoleSchema, Role, systemProjectRoleSchema, roleNamespaceSchema, teamRoleSchema, workflowSharingRoleSchema, assignableProjectRoleSchema } from './schemas.ee';
|
|
4
|
+
export type ScopeInformation = {
|
|
5
|
+
displayName: string;
|
|
6
|
+
description?: string | null;
|
|
7
|
+
};
|
|
8
|
+
export type Resource = keyof typeof RESOURCES;
|
|
9
|
+
type ResourceScope<R extends Resource, Operation extends (typeof RESOURCES)[R][number] = (typeof RESOURCES)[R][number]> = `${R}:${Operation}`;
|
|
10
|
+
type WildcardScope = `${Resource}:*` | '*';
|
|
11
|
+
type AllScopesObject = {
|
|
12
|
+
[R in Resource]: ResourceScope<R>;
|
|
13
|
+
};
|
|
14
|
+
export type Scope = AllScopesObject[Resource] | WildcardScope;
|
|
15
|
+
export type ScopeLevels = {
|
|
16
|
+
global: Scope[];
|
|
17
|
+
project?: Scope[];
|
|
18
|
+
resource?: Scope[];
|
|
19
|
+
};
|
|
20
|
+
export type MaskLevels = {
|
|
21
|
+
sharing: Scope[];
|
|
22
|
+
};
|
|
23
|
+
export type ScopeOptions = {
|
|
24
|
+
mode: 'oneOf' | 'allOf';
|
|
25
|
+
};
|
|
26
|
+
export type RoleNamespace = z.infer<typeof roleNamespaceSchema>;
|
|
27
|
+
export type GlobalRole = z.infer<typeof globalRoleSchema>;
|
|
28
|
+
export type AssignableGlobalRole = z.infer<typeof assignableGlobalRoleSchema>;
|
|
29
|
+
export type CredentialSharingRole = z.infer<typeof credentialSharingRoleSchema>;
|
|
30
|
+
export type WorkflowSharingRole = z.infer<typeof workflowSharingRoleSchema>;
|
|
31
|
+
export type TeamProjectRole = z.infer<typeof teamRoleSchema>;
|
|
32
|
+
export type ProjectRole = z.infer<typeof systemProjectRoleSchema>;
|
|
33
|
+
export type AssignableProjectRole = z.infer<typeof assignableProjectRoleSchema>;
|
|
34
|
+
export declare function isAssignableProjectRoleSlug(slug: string): slug is AssignableProjectRole;
|
|
35
|
+
export type AllRoleTypes = GlobalRole | ProjectRole | WorkflowSharingRole | CredentialSharingRole;
|
|
36
|
+
export type AllRolesMap = {
|
|
37
|
+
global: Role[];
|
|
38
|
+
project: Role[];
|
|
39
|
+
credential: Role[];
|
|
40
|
+
workflow: Role[];
|
|
41
|
+
};
|
|
42
|
+
export type DbScope = {
|
|
43
|
+
slug: Scope;
|
|
44
|
+
};
|
|
45
|
+
export type DbRole = {
|
|
46
|
+
slug: string;
|
|
47
|
+
scopes: DbScope[];
|
|
48
|
+
};
|
|
49
|
+
export type AuthPrincipal = {
|
|
50
|
+
role: DbRole;
|
|
51
|
+
};
|
|
52
|
+
type PublicApiKeyResources = keyof typeof API_KEY_RESOURCES;
|
|
53
|
+
type ApiKeyResourceScope<R extends PublicApiKeyResources, Operation extends (typeof API_KEY_RESOURCES)[R][number] = (typeof API_KEY_RESOURCES)[R][number]> = `${R}:${Operation}`;
|
|
54
|
+
type AllApiKeyScopesObject = {
|
|
55
|
+
[R in PublicApiKeyResources]: ApiKeyResourceScope<R>;
|
|
56
|
+
};
|
|
57
|
+
export type ApiKeyScope = AllApiKeyScopesObject[PublicApiKeyResources];
|
|
58
|
+
export declare function isApiKeyScope(scope: Scope): scope is ApiKeyScope;
|
|
59
|
+
export {};
|
package/dist/types.ee.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isAssignableProjectRoleSlug = isAssignableProjectRoleSlug;
|
|
4
|
+
exports.isApiKeyScope = isApiKeyScope;
|
|
5
|
+
const constants_ee_1 = require("./constants.ee");
|
|
6
|
+
const scope_information_1 = require("./scope-information");
|
|
7
|
+
function isAssignableProjectRoleSlug(slug) {
|
|
8
|
+
return slug.startsWith('project:') && slug !== constants_ee_1.PROJECT_OWNER_ROLE_SLUG;
|
|
9
|
+
}
|
|
10
|
+
function isApiKeyScope(scope) {
|
|
11
|
+
return scope_information_1.ALL_API_KEY_SCOPES.has(scope);
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=types.ee.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.ee.js","sourceRoot":"","sources":["../src/types.ee.ts"],"names":[],"mappings":";;AAyEA,kEAEC;AA8CD,sCAGC;AA9GD,iDAAyD;AACzD,2DAAyD;AA0DzD,SAAgB,2BAA2B,CAAC,IAAY;IACvD,OAAO,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,IAAI,IAAI,KAAK,sCAAuB,CAAC;AACxE,CAAC;AA8CD,SAAgB,aAAa,CAAC,KAAY;IAEzC,OAAO,sCAAkB,CAAC,GAAG,CAAC,KAAoB,CAAC,CAAC;AACrD,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.combineScopes = combineScopes;
|
|
4
|
+
function combineScopes(userScopes, masks) {
|
|
5
|
+
const maskedScopes = Object.fromEntries(Object.entries(userScopes).map((e) => [e[0], [...e[1]]]));
|
|
6
|
+
if (masks?.sharing) {
|
|
7
|
+
if (maskedScopes.project) {
|
|
8
|
+
maskedScopes.project = maskedScopes.project.filter((v) => masks.sharing.includes(v));
|
|
9
|
+
}
|
|
10
|
+
if (maskedScopes.resource) {
|
|
11
|
+
maskedScopes.resource = maskedScopes.resource.filter((v) => masks.sharing.includes(v));
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
return new Set(Object.values(maskedScopes).flat());
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=combine-scopes.ee.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"combine-scopes.ee.js","sourceRoot":"","sources":["../../src/utilities/combine-scopes.ee.ts"],"names":[],"mappings":";;AAeA,sCAeC;AAfD,SAAgB,aAAa,CAAC,UAAuB,EAAE,KAAkB;IACxE,MAAM,YAAY,GAAgB,MAAM,CAAC,WAAW,CACnD,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CACzC,CAAC;IAEjB,IAAI,KAAK,EAAE,OAAO,EAAE,CAAC;QACpB,IAAI,YAAY,CAAC,OAAO,EAAE,CAAC;YAC1B,YAAY,CAAC,OAAO,GAAG,YAAY,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;QACtF,CAAC;QACD,IAAI,YAAY,CAAC,QAAQ,EAAE,CAAC;YAC3B,YAAY,CAAC,QAAQ,GAAG,YAAY,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;QACxF,CAAC;IACF,CAAC;IAED,OAAO,IAAI,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;AACpD,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getGlobalScopes = void 0;
|
|
4
|
+
const getGlobalScopes = (principal) => principal.role.scopes.map((scope) => scope.slug) ?? [];
|
|
5
|
+
exports.getGlobalScopes = getGlobalScopes;
|
|
6
|
+
//# sourceMappingURL=get-global-scopes.ee.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-global-scopes.ee.js","sourceRoot":"","sources":["../../src/utilities/get-global-scopes.ee.ts"],"names":[],"mappings":";;;AAOO,MAAM,eAAe,GAAG,CAAC,SAAwB,EAAE,EAAE,CAC3D,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;AAD3C,QAAA,eAAe,mBAC4B"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { RESOURCES } from '../constants.ee';
|
|
2
|
+
import type { Scope } from '../types.ee';
|
|
3
|
+
type ActionBooleans<T extends readonly string[]> = {
|
|
4
|
+
[K in T[number]]?: boolean;
|
|
5
|
+
};
|
|
6
|
+
export type PermissionsRecord = {
|
|
7
|
+
[K in keyof typeof RESOURCES]: ActionBooleans<(typeof RESOURCES)[K]>;
|
|
8
|
+
};
|
|
9
|
+
export declare const getResourcePermissions: (resourceScopes?: Scope[]) => PermissionsRecord;
|
|
10
|
+
export {};
|