@lightdash/common 0.2562.0 → 0.2563.1
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/cjs/.tsbuildinfo +1 -1
- package/dist/cjs/authorization/index.mock.d.ts +1 -1
- package/dist/cjs/authorization/index.mock.js +1 -1
- package/dist/cjs/authorization/index.mock.js.map +1 -1
- package/dist/cjs/authorization/index.test.js +12 -12
- package/dist/cjs/authorization/index.test.js.map +1 -1
- package/dist/cjs/authorization/jwtAbility.test.js +2 -2
- package/dist/cjs/authorization/jwtAbility.test.js.map +1 -1
- package/dist/cjs/authorization/organizationMemberAbility.d.ts.map +1 -1
- package/dist/cjs/authorization/organizationMemberAbility.js +20 -0
- package/dist/cjs/authorization/organizationMemberAbility.js.map +1 -1
- package/dist/cjs/authorization/organizationMemberAbility.test.js +88 -82
- package/dist/cjs/authorization/organizationMemberAbility.test.js.map +1 -1
- package/dist/cjs/authorization/projectMemberAbility.d.ts.map +1 -1
- package/dist/cjs/authorization/projectMemberAbility.js +20 -0
- package/dist/cjs/authorization/projectMemberAbility.js.map +1 -1
- package/dist/cjs/authorization/projectMemberAbility.test.js +124 -94
- package/dist/cjs/authorization/projectMemberAbility.test.js.map +1 -1
- package/dist/cjs/authorization/roleToScopeMapping.test.js +8 -8
- package/dist/cjs/authorization/roleToScopeMapping.test.js.map +1 -1
- package/dist/cjs/authorization/roleToScopeMapping.testUtils.d.ts +119 -119
- package/dist/cjs/authorization/roleToScopeMapping.testUtils.js +4 -4
- package/dist/cjs/authorization/roleToScopeMapping.testUtils.js.map +1 -1
- package/dist/cjs/authorization/roleToScopeParity.test.js +10 -3
- package/dist/cjs/authorization/roleToScopeParity.test.js.map +1 -1
- package/dist/cjs/authorization/scopeAbilityBuilder.test.js +17 -17
- package/dist/cjs/authorization/scopeAbilityBuilder.test.js.map +1 -1
- package/dist/cjs/authorization/scopes.d.ts.map +1 -1
- package/dist/cjs/authorization/scopes.js +8 -0
- package/dist/cjs/authorization/scopes.js.map +1 -1
- package/dist/cjs/authorization/serviceAccountAbility.d.ts.map +1 -1
- package/dist/cjs/authorization/serviceAccountAbility.js +20 -0
- package/dist/cjs/authorization/serviceAccountAbility.js.map +1 -1
- package/dist/cjs/types/dashboard.d.ts +2 -1
- package/dist/cjs/types/dashboard.d.ts.map +1 -1
- package/dist/cjs/types/dashboard.js.map +1 -1
- package/dist/cjs/types/metricQuery.d.ts +4 -0
- package/dist/cjs/types/metricQuery.d.ts.map +1 -1
- package/dist/cjs/types/metricQuery.js.map +1 -1
- package/dist/cjs/types/savedCharts.d.ts +3 -2
- package/dist/cjs/types/savedCharts.d.ts.map +1 -1
- package/dist/cjs/types/savedCharts.js.map +1 -1
- package/dist/cjs/types/space.d.ts +1 -0
- package/dist/cjs/types/space.d.ts.map +1 -1
- package/dist/cjs/types/space.js.map +1 -1
- package/dist/cjs/utils/filters.d.ts.map +1 -1
- package/dist/cjs/utils/filters.js +6 -3
- package/dist/cjs/utils/filters.js.map +1 -1
- package/dist/cjs/utils/tableCalculationFunctions.d.ts +55 -2
- package/dist/cjs/utils/tableCalculationFunctions.d.ts.map +1 -1
- package/dist/cjs/utils/tableCalculationFunctions.js +151 -1
- package/dist/cjs/utils/tableCalculationFunctions.js.map +1 -1
- package/dist/cjs/utils/tableCalculationFunctions.test.js +178 -0
- package/dist/cjs/utils/tableCalculationFunctions.test.js.map +1 -1
- package/dist/esm/.tsbuildinfo +1 -1
- package/dist/esm/authorization/index.mock.d.ts +1 -1
- package/dist/esm/authorization/index.mock.js +1 -1
- package/dist/esm/authorization/index.mock.js.map +1 -1
- package/dist/esm/authorization/index.test.js +12 -12
- package/dist/esm/authorization/index.test.js.map +1 -1
- package/dist/esm/authorization/jwtAbility.test.js +2 -2
- package/dist/esm/authorization/jwtAbility.test.js.map +1 -1
- package/dist/esm/authorization/organizationMemberAbility.d.ts.map +1 -1
- package/dist/esm/authorization/organizationMemberAbility.js +20 -0
- package/dist/esm/authorization/organizationMemberAbility.js.map +1 -1
- package/dist/esm/authorization/organizationMemberAbility.test.js +88 -82
- package/dist/esm/authorization/organizationMemberAbility.test.js.map +1 -1
- package/dist/esm/authorization/projectMemberAbility.d.ts.map +1 -1
- package/dist/esm/authorization/projectMemberAbility.js +20 -0
- package/dist/esm/authorization/projectMemberAbility.js.map +1 -1
- package/dist/esm/authorization/projectMemberAbility.test.js +124 -94
- package/dist/esm/authorization/projectMemberAbility.test.js.map +1 -1
- package/dist/esm/authorization/roleToScopeMapping.test.js +8 -8
- package/dist/esm/authorization/roleToScopeMapping.test.js.map +1 -1
- package/dist/esm/authorization/roleToScopeMapping.testUtils.d.ts +119 -119
- package/dist/esm/authorization/roleToScopeMapping.testUtils.js +4 -4
- package/dist/esm/authorization/roleToScopeMapping.testUtils.js.map +1 -1
- package/dist/esm/authorization/roleToScopeParity.test.js +10 -3
- package/dist/esm/authorization/roleToScopeParity.test.js.map +1 -1
- package/dist/esm/authorization/scopeAbilityBuilder.test.js +17 -17
- package/dist/esm/authorization/scopeAbilityBuilder.test.js.map +1 -1
- package/dist/esm/authorization/scopes.d.ts.map +1 -1
- package/dist/esm/authorization/scopes.js +8 -0
- package/dist/esm/authorization/scopes.js.map +1 -1
- package/dist/esm/authorization/serviceAccountAbility.d.ts.map +1 -1
- package/dist/esm/authorization/serviceAccountAbility.js +20 -0
- package/dist/esm/authorization/serviceAccountAbility.js.map +1 -1
- package/dist/esm/types/dashboard.d.ts +2 -1
- package/dist/esm/types/dashboard.d.ts.map +1 -1
- package/dist/esm/types/dashboard.js.map +1 -1
- package/dist/esm/types/metricQuery.d.ts +4 -0
- package/dist/esm/types/metricQuery.d.ts.map +1 -1
- package/dist/esm/types/metricQuery.js.map +1 -1
- package/dist/esm/types/savedCharts.d.ts +3 -2
- package/dist/esm/types/savedCharts.d.ts.map +1 -1
- package/dist/esm/types/savedCharts.js.map +1 -1
- package/dist/esm/types/space.d.ts +1 -0
- package/dist/esm/types/space.d.ts.map +1 -1
- package/dist/esm/types/space.js.map +1 -1
- package/dist/esm/utils/filters.d.ts.map +1 -1
- package/dist/esm/utils/filters.js +6 -3
- package/dist/esm/utils/filters.js.map +1 -1
- package/dist/esm/utils/tableCalculationFunctions.d.ts +55 -2
- package/dist/esm/utils/tableCalculationFunctions.d.ts.map +1 -1
- package/dist/esm/utils/tableCalculationFunctions.js +146 -0
- package/dist/esm/utils/tableCalculationFunctions.js.map +1 -1
- package/dist/esm/utils/tableCalculationFunctions.test.js +179 -1
- package/dist/esm/utils/tableCalculationFunctions.test.js.map +1 -1
- package/dist/types/.tsbuildinfo +1 -1
- package/dist/types/authorization/index.mock.d.ts +1 -1
- package/dist/types/authorization/index.mock.js +1 -1
- package/dist/types/authorization/index.mock.js.map +1 -1
- package/dist/types/authorization/index.test.js +12 -12
- package/dist/types/authorization/index.test.js.map +1 -1
- package/dist/types/authorization/jwtAbility.test.js +2 -2
- package/dist/types/authorization/jwtAbility.test.js.map +1 -1
- package/dist/types/authorization/organizationMemberAbility.d.ts.map +1 -1
- package/dist/types/authorization/organizationMemberAbility.js +20 -0
- package/dist/types/authorization/organizationMemberAbility.js.map +1 -1
- package/dist/types/authorization/organizationMemberAbility.test.js +88 -82
- package/dist/types/authorization/organizationMemberAbility.test.js.map +1 -1
- package/dist/types/authorization/projectMemberAbility.d.ts.map +1 -1
- package/dist/types/authorization/projectMemberAbility.js +20 -0
- package/dist/types/authorization/projectMemberAbility.js.map +1 -1
- package/dist/types/authorization/projectMemberAbility.test.js +124 -94
- package/dist/types/authorization/projectMemberAbility.test.js.map +1 -1
- package/dist/types/authorization/roleToScopeMapping.test.js +8 -8
- package/dist/types/authorization/roleToScopeMapping.test.js.map +1 -1
- package/dist/types/authorization/roleToScopeMapping.testUtils.d.ts +119 -119
- package/dist/types/authorization/roleToScopeMapping.testUtils.js +4 -4
- package/dist/types/authorization/roleToScopeMapping.testUtils.js.map +1 -1
- package/dist/types/authorization/roleToScopeParity.test.js +10 -3
- package/dist/types/authorization/roleToScopeParity.test.js.map +1 -1
- package/dist/types/authorization/scopeAbilityBuilder.test.js +17 -17
- package/dist/types/authorization/scopeAbilityBuilder.test.js.map +1 -1
- package/dist/types/authorization/scopes.d.ts.map +1 -1
- package/dist/types/authorization/scopes.js +8 -0
- package/dist/types/authorization/scopes.js.map +1 -1
- package/dist/types/authorization/serviceAccountAbility.d.ts.map +1 -1
- package/dist/types/authorization/serviceAccountAbility.js +20 -0
- package/dist/types/authorization/serviceAccountAbility.js.map +1 -1
- package/dist/types/types/dashboard.d.ts +2 -1
- package/dist/types/types/dashboard.d.ts.map +1 -1
- package/dist/types/types/dashboard.js.map +1 -1
- package/dist/types/types/metricQuery.d.ts +4 -0
- package/dist/types/types/metricQuery.d.ts.map +1 -1
- package/dist/types/types/metricQuery.js.map +1 -1
- package/dist/types/types/savedCharts.d.ts +3 -2
- package/dist/types/types/savedCharts.d.ts.map +1 -1
- package/dist/types/types/savedCharts.js.map +1 -1
- package/dist/types/types/space.d.ts +1 -0
- package/dist/types/types/space.d.ts.map +1 -1
- package/dist/types/types/space.js.map +1 -1
- package/dist/types/utils/filters.d.ts.map +1 -1
- package/dist/types/utils/filters.js +6 -3
- package/dist/types/utils/filters.js.map +1 -1
- package/dist/types/utils/tableCalculationFunctions.d.ts +55 -2
- package/dist/types/utils/tableCalculationFunctions.d.ts.map +1 -1
- package/dist/types/utils/tableCalculationFunctions.js +146 -0
- package/dist/types/utils/tableCalculationFunctions.js.map +1 -1
- package/dist/types/utils/tableCalculationFunctions.test.js +179 -1
- package/dist/types/utils/tableCalculationFunctions.test.js.map +1 -1
- package/package.json +1 -1
|
@@ -54,25 +54,25 @@ describe('Organization member permissions', () => {
|
|
|
54
54
|
it('can view and manage all kinds of dashboards', () => {
|
|
55
55
|
expect(ability.can('view', subject('Dashboard', {
|
|
56
56
|
organizationUuid: ORGANIZATION_ADMIN.organizationUuid,
|
|
57
|
-
|
|
57
|
+
inheritsFromOrgOrProject: true,
|
|
58
58
|
}))).toEqual(true);
|
|
59
59
|
expect(ability.can('manage', subject('Dashboard', {
|
|
60
60
|
organizationUuid: ORGANIZATION_ADMIN.organizationUuid,
|
|
61
|
-
|
|
61
|
+
inheritsFromOrgOrProject: true,
|
|
62
62
|
}))).toEqual(true);
|
|
63
63
|
expect(ability.can('view', subject('Dashboard', {
|
|
64
64
|
organizationUuid: ORGANIZATION_ADMIN.organizationUuid,
|
|
65
|
-
|
|
65
|
+
inheritsFromOrgOrProject: false,
|
|
66
66
|
access: [],
|
|
67
67
|
}))).toEqual(true);
|
|
68
68
|
expect(ability.can('manage', subject('Dashboard', {
|
|
69
69
|
organizationUuid: ORGANIZATION_ADMIN.organizationUuid,
|
|
70
|
-
|
|
70
|
+
inheritsFromOrgOrProject: false,
|
|
71
71
|
access: [],
|
|
72
72
|
}))).toEqual(true);
|
|
73
73
|
expect(ability.can('view', subject('Dashboard', {
|
|
74
74
|
organizationUuid: ORGANIZATION_ADMIN.organizationUuid,
|
|
75
|
-
|
|
75
|
+
inheritsFromOrgOrProject: false,
|
|
76
76
|
access: [
|
|
77
77
|
{
|
|
78
78
|
userUuid: ORGANIZATION_ADMIN.userUuid,
|
|
@@ -82,7 +82,7 @@ describe('Organization member permissions', () => {
|
|
|
82
82
|
}))).toEqual(true);
|
|
83
83
|
expect(ability.can('manage', subject('Dashboard', {
|
|
84
84
|
organizationUuid: ORGANIZATION_ADMIN.organizationUuid,
|
|
85
|
-
|
|
85
|
+
inheritsFromOrgOrProject: false,
|
|
86
86
|
access: [
|
|
87
87
|
{
|
|
88
88
|
userUuid: ORGANIZATION_ADMIN.userUuid,
|
|
@@ -92,7 +92,7 @@ describe('Organization member permissions', () => {
|
|
|
92
92
|
}))).toEqual(true);
|
|
93
93
|
expect(ability.can('view', subject('Dashboard', {
|
|
94
94
|
organizationUuid: ORGANIZATION_ADMIN.organizationUuid,
|
|
95
|
-
|
|
95
|
+
inheritsFromOrgOrProject: false,
|
|
96
96
|
access: [
|
|
97
97
|
{
|
|
98
98
|
userUuid: ORGANIZATION_ADMIN.userUuid,
|
|
@@ -102,7 +102,7 @@ describe('Organization member permissions', () => {
|
|
|
102
102
|
}))).toEqual(true);
|
|
103
103
|
expect(ability.can('manage', subject('Dashboard', {
|
|
104
104
|
organizationUuid: ORGANIZATION_ADMIN.organizationUuid,
|
|
105
|
-
|
|
105
|
+
inheritsFromOrgOrProject: false,
|
|
106
106
|
access: [
|
|
107
107
|
{
|
|
108
108
|
userUuid: ORGANIZATION_ADMIN.userUuid,
|
|
@@ -114,25 +114,25 @@ describe('Organization member permissions', () => {
|
|
|
114
114
|
it('can view and manage all kinds of saved charts', () => {
|
|
115
115
|
expect(ability.can('view', subject('SavedChart', {
|
|
116
116
|
organizationUuid: ORGANIZATION_ADMIN.organizationUuid,
|
|
117
|
-
|
|
117
|
+
inheritsFromOrgOrProject: true,
|
|
118
118
|
}))).toEqual(true);
|
|
119
119
|
expect(ability.can('manage', subject('SavedChart', {
|
|
120
120
|
organizationUuid: ORGANIZATION_ADMIN.organizationUuid,
|
|
121
|
-
|
|
121
|
+
inheritsFromOrgOrProject: true,
|
|
122
122
|
}))).toEqual(true);
|
|
123
123
|
expect(ability.can('view', subject('SavedChart', {
|
|
124
124
|
organizationUuid: ORGANIZATION_ADMIN.organizationUuid,
|
|
125
|
-
|
|
125
|
+
inheritsFromOrgOrProject: false,
|
|
126
126
|
access: [],
|
|
127
127
|
}))).toEqual(true);
|
|
128
128
|
expect(ability.can('manage', subject('SavedChart', {
|
|
129
129
|
organizationUuid: ORGANIZATION_ADMIN.organizationUuid,
|
|
130
|
-
|
|
130
|
+
inheritsFromOrgOrProject: false,
|
|
131
131
|
access: [],
|
|
132
132
|
}))).toEqual(true);
|
|
133
133
|
expect(ability.can('view', subject('SavedChart', {
|
|
134
134
|
organizationUuid: ORGANIZATION_ADMIN.organizationUuid,
|
|
135
|
-
|
|
135
|
+
inheritsFromOrgOrProject: false,
|
|
136
136
|
access: [
|
|
137
137
|
{
|
|
138
138
|
userUuid: ORGANIZATION_ADMIN.userUuid,
|
|
@@ -142,7 +142,7 @@ describe('Organization member permissions', () => {
|
|
|
142
142
|
}))).toEqual(true);
|
|
143
143
|
expect(ability.can('manage', subject('SavedChart', {
|
|
144
144
|
organizationUuid: ORGANIZATION_ADMIN.organizationUuid,
|
|
145
|
-
|
|
145
|
+
inheritsFromOrgOrProject: false,
|
|
146
146
|
access: [
|
|
147
147
|
{
|
|
148
148
|
userUuid: ORGANIZATION_ADMIN.userUuid,
|
|
@@ -152,7 +152,7 @@ describe('Organization member permissions', () => {
|
|
|
152
152
|
}))).toEqual(true);
|
|
153
153
|
expect(ability.can('view', subject('SavedChart', {
|
|
154
154
|
organizationUuid: ORGANIZATION_ADMIN.organizationUuid,
|
|
155
|
-
|
|
155
|
+
inheritsFromOrgOrProject: false,
|
|
156
156
|
access: [
|
|
157
157
|
{
|
|
158
158
|
userUuid: ORGANIZATION_ADMIN.userUuid,
|
|
@@ -162,7 +162,7 @@ describe('Organization member permissions', () => {
|
|
|
162
162
|
}))).toEqual(true);
|
|
163
163
|
expect(ability.can('manage', subject('SavedChart', {
|
|
164
164
|
organizationUuid: ORGANIZATION_ADMIN.organizationUuid,
|
|
165
|
-
|
|
165
|
+
inheritsFromOrgOrProject: false,
|
|
166
166
|
access: [
|
|
167
167
|
{
|
|
168
168
|
userUuid: ORGANIZATION_ADMIN.userUuid,
|
|
@@ -174,25 +174,25 @@ describe('Organization member permissions', () => {
|
|
|
174
174
|
it('can view and manage all kinds of space', () => {
|
|
175
175
|
expect(ability.can('view', subject('Space', {
|
|
176
176
|
organizationUuid: ORGANIZATION_ADMIN.organizationUuid,
|
|
177
|
-
|
|
177
|
+
inheritsFromOrgOrProject: true,
|
|
178
178
|
}))).toEqual(true);
|
|
179
179
|
expect(ability.can('manage', subject('Space', {
|
|
180
180
|
organizationUuid: ORGANIZATION_ADMIN.organizationUuid,
|
|
181
|
-
|
|
181
|
+
inheritsFromOrgOrProject: true,
|
|
182
182
|
}))).toEqual(true);
|
|
183
183
|
expect(ability.can('view', subject('Space', {
|
|
184
184
|
organizationUuid: ORGANIZATION_ADMIN.organizationUuid,
|
|
185
|
-
|
|
185
|
+
inheritsFromOrgOrProject: false,
|
|
186
186
|
access: [],
|
|
187
187
|
}))).toEqual(true);
|
|
188
188
|
expect(ability.can('manage', subject('Space', {
|
|
189
189
|
organizationUuid: ORGANIZATION_ADMIN.organizationUuid,
|
|
190
|
-
|
|
190
|
+
inheritsFromOrgOrProject: false,
|
|
191
191
|
access: [],
|
|
192
192
|
}))).toEqual(true);
|
|
193
193
|
expect(ability.can('view', subject('Space', {
|
|
194
194
|
organizationUuid: ORGANIZATION_ADMIN.organizationUuid,
|
|
195
|
-
|
|
195
|
+
inheritsFromOrgOrProject: false,
|
|
196
196
|
access: [
|
|
197
197
|
{
|
|
198
198
|
userUuid: ORGANIZATION_ADMIN.userUuid,
|
|
@@ -202,7 +202,7 @@ describe('Organization member permissions', () => {
|
|
|
202
202
|
}))).toEqual(true);
|
|
203
203
|
expect(ability.can('manage', subject('Space', {
|
|
204
204
|
organizationUuid: ORGANIZATION_ADMIN.organizationUuid,
|
|
205
|
-
|
|
205
|
+
inheritsFromOrgOrProject: false,
|
|
206
206
|
access: [
|
|
207
207
|
{
|
|
208
208
|
userUuid: ORGANIZATION_ADMIN.userUuid,
|
|
@@ -212,7 +212,7 @@ describe('Organization member permissions', () => {
|
|
|
212
212
|
}))).toEqual(true);
|
|
213
213
|
expect(ability.can('view', subject('Space', {
|
|
214
214
|
organizationUuid: ORGANIZATION_ADMIN.organizationUuid,
|
|
215
|
-
|
|
215
|
+
inheritsFromOrgOrProject: false,
|
|
216
216
|
access: [
|
|
217
217
|
{
|
|
218
218
|
userUuid: ORGANIZATION_ADMIN.userUuid,
|
|
@@ -222,7 +222,7 @@ describe('Organization member permissions', () => {
|
|
|
222
222
|
}))).toEqual(true);
|
|
223
223
|
expect(ability.can('manage', subject('Space', {
|
|
224
224
|
organizationUuid: ORGANIZATION_ADMIN.organizationUuid,
|
|
225
|
-
|
|
225
|
+
inheritsFromOrgOrProject: false,
|
|
226
226
|
access: [
|
|
227
227
|
{
|
|
228
228
|
userUuid: ORGANIZATION_ADMIN.userUuid,
|
|
@@ -314,25 +314,25 @@ describe('Organization member permissions', () => {
|
|
|
314
314
|
it('can view and manage public & accessable dashboards', () => {
|
|
315
315
|
expect(ability.can('view', subject('Dashboard', {
|
|
316
316
|
organizationUuid: ORGANIZATION_EDITOR.organizationUuid,
|
|
317
|
-
|
|
317
|
+
inheritsFromOrgOrProject: true,
|
|
318
318
|
}))).toEqual(true);
|
|
319
319
|
expect(ability.can('manage', subject('Dashboard', {
|
|
320
320
|
organizationUuid: ORGANIZATION_EDITOR.organizationUuid,
|
|
321
|
-
|
|
321
|
+
inheritsFromOrgOrProject: true,
|
|
322
322
|
}))).toEqual(false);
|
|
323
323
|
expect(ability.can('view', subject('Dashboard', {
|
|
324
324
|
organizationUuid: ORGANIZATION_EDITOR.organizationUuid,
|
|
325
|
-
|
|
325
|
+
inheritsFromOrgOrProject: false,
|
|
326
326
|
access: [],
|
|
327
327
|
}))).toEqual(false);
|
|
328
328
|
expect(ability.can('manage', subject('Dashboard', {
|
|
329
329
|
organizationUuid: ORGANIZATION_EDITOR.organizationUuid,
|
|
330
|
-
|
|
330
|
+
inheritsFromOrgOrProject: false,
|
|
331
331
|
access: [],
|
|
332
332
|
}))).toEqual(false);
|
|
333
333
|
expect(ability.can('view', subject('Dashboard', {
|
|
334
334
|
organizationUuid: ORGANIZATION_EDITOR.organizationUuid,
|
|
335
|
-
|
|
335
|
+
inheritsFromOrgOrProject: false,
|
|
336
336
|
access: [
|
|
337
337
|
{
|
|
338
338
|
userUuid: ORGANIZATION_EDITOR.userUuid,
|
|
@@ -342,7 +342,7 @@ describe('Organization member permissions', () => {
|
|
|
342
342
|
}))).toEqual(true);
|
|
343
343
|
expect(ability.can('manage', subject('Dashboard', {
|
|
344
344
|
organizationUuid: ORGANIZATION_EDITOR.organizationUuid,
|
|
345
|
-
|
|
345
|
+
inheritsFromOrgOrProject: false,
|
|
346
346
|
access: [
|
|
347
347
|
{
|
|
348
348
|
userUuid: ORGANIZATION_EDITOR.userUuid,
|
|
@@ -352,7 +352,7 @@ describe('Organization member permissions', () => {
|
|
|
352
352
|
}))).toEqual(false);
|
|
353
353
|
expect(ability.can('view', subject('Dashboard', {
|
|
354
354
|
organizationUuid: ORGANIZATION_EDITOR.organizationUuid,
|
|
355
|
-
|
|
355
|
+
inheritsFromOrgOrProject: false,
|
|
356
356
|
access: [
|
|
357
357
|
{
|
|
358
358
|
userUuid: ORGANIZATION_EDITOR.userUuid,
|
|
@@ -362,7 +362,7 @@ describe('Organization member permissions', () => {
|
|
|
362
362
|
}))).toEqual(true);
|
|
363
363
|
expect(ability.can('manage', subject('Dashboard', {
|
|
364
364
|
organizationUuid: ORGANIZATION_EDITOR.organizationUuid,
|
|
365
|
-
|
|
365
|
+
inheritsFromOrgOrProject: false,
|
|
366
366
|
access: [
|
|
367
367
|
{
|
|
368
368
|
userUuid: ORGANIZATION_EDITOR.userUuid,
|
|
@@ -374,25 +374,25 @@ describe('Organization member permissions', () => {
|
|
|
374
374
|
it('can view and manage public & accessable saved charts', () => {
|
|
375
375
|
expect(ability.can('view', subject('SavedChart', {
|
|
376
376
|
organizationUuid: ORGANIZATION_EDITOR.organizationUuid,
|
|
377
|
-
|
|
377
|
+
inheritsFromOrgOrProject: true,
|
|
378
378
|
}))).toEqual(true);
|
|
379
379
|
expect(ability.can('manage', subject('SavedChart', {
|
|
380
380
|
organizationUuid: ORGANIZATION_EDITOR.organizationUuid,
|
|
381
|
-
|
|
381
|
+
inheritsFromOrgOrProject: true,
|
|
382
382
|
}))).toEqual(false);
|
|
383
383
|
expect(ability.can('view', subject('SavedChart', {
|
|
384
384
|
organizationUuid: ORGANIZATION_EDITOR.organizationUuid,
|
|
385
|
-
|
|
385
|
+
inheritsFromOrgOrProject: false,
|
|
386
386
|
access: [],
|
|
387
387
|
}))).toEqual(false);
|
|
388
388
|
expect(ability.can('manage', subject('SavedChart', {
|
|
389
389
|
organizationUuid: ORGANIZATION_EDITOR.organizationUuid,
|
|
390
|
-
|
|
390
|
+
inheritsFromOrgOrProject: false,
|
|
391
391
|
access: [],
|
|
392
392
|
}))).toEqual(false);
|
|
393
393
|
expect(ability.can('view', subject('SavedChart', {
|
|
394
394
|
organizationUuid: ORGANIZATION_EDITOR.organizationUuid,
|
|
395
|
-
|
|
395
|
+
inheritsFromOrgOrProject: false,
|
|
396
396
|
access: [
|
|
397
397
|
{
|
|
398
398
|
userUuid: ORGANIZATION_EDITOR.userUuid,
|
|
@@ -402,7 +402,7 @@ describe('Organization member permissions', () => {
|
|
|
402
402
|
}))).toEqual(true);
|
|
403
403
|
expect(ability.can('manage', subject('SavedChart', {
|
|
404
404
|
organizationUuid: ORGANIZATION_EDITOR.organizationUuid,
|
|
405
|
-
|
|
405
|
+
inheritsFromOrgOrProject: false,
|
|
406
406
|
access: [
|
|
407
407
|
{
|
|
408
408
|
userUuid: ORGANIZATION_EDITOR.userUuid,
|
|
@@ -412,7 +412,7 @@ describe('Organization member permissions', () => {
|
|
|
412
412
|
}))).toEqual(false);
|
|
413
413
|
expect(ability.can('view', subject('SavedChart', {
|
|
414
414
|
organizationUuid: ORGANIZATION_EDITOR.organizationUuid,
|
|
415
|
-
|
|
415
|
+
inheritsFromOrgOrProject: false,
|
|
416
416
|
access: [
|
|
417
417
|
{
|
|
418
418
|
userUuid: ORGANIZATION_EDITOR.userUuid,
|
|
@@ -422,7 +422,7 @@ describe('Organization member permissions', () => {
|
|
|
422
422
|
}))).toEqual(true);
|
|
423
423
|
expect(ability.can('manage', subject('SavedChart', {
|
|
424
424
|
organizationUuid: ORGANIZATION_EDITOR.organizationUuid,
|
|
425
|
-
|
|
425
|
+
inheritsFromOrgOrProject: false,
|
|
426
426
|
access: [
|
|
427
427
|
{
|
|
428
428
|
userUuid: ORGANIZATION_EDITOR.userUuid,
|
|
@@ -439,25 +439,25 @@ describe('Organization member permissions', () => {
|
|
|
439
439
|
it('can view and manage public & accessable space', () => {
|
|
440
440
|
expect(ability.can('view', subject('Space', {
|
|
441
441
|
organizationUuid: ORGANIZATION_EDITOR.organizationUuid,
|
|
442
|
-
|
|
442
|
+
inheritsFromOrgOrProject: true,
|
|
443
443
|
}))).toEqual(true);
|
|
444
444
|
expect(ability.can('manage', subject('Space', {
|
|
445
445
|
organizationUuid: ORGANIZATION_EDITOR.organizationUuid,
|
|
446
|
-
|
|
446
|
+
inheritsFromOrgOrProject: true,
|
|
447
447
|
}))).toEqual(true);
|
|
448
448
|
expect(ability.can('view', subject('Space', {
|
|
449
449
|
organizationUuid: ORGANIZATION_EDITOR.organizationUuid,
|
|
450
|
-
|
|
450
|
+
inheritsFromOrgOrProject: false,
|
|
451
451
|
access: [],
|
|
452
452
|
}))).toEqual(false);
|
|
453
453
|
expect(ability.can('manage', subject('Space', {
|
|
454
454
|
organizationUuid: ORGANIZATION_EDITOR.organizationUuid,
|
|
455
|
-
|
|
455
|
+
inheritsFromOrgOrProject: false,
|
|
456
456
|
access: [],
|
|
457
457
|
}))).toEqual(false);
|
|
458
458
|
expect(ability.can('view', subject('Space', {
|
|
459
459
|
organizationUuid: ORGANIZATION_EDITOR.organizationUuid,
|
|
460
|
-
|
|
460
|
+
inheritsFromOrgOrProject: false,
|
|
461
461
|
access: [
|
|
462
462
|
{
|
|
463
463
|
userUuid: ORGANIZATION_EDITOR.userUuid,
|
|
@@ -467,7 +467,7 @@ describe('Organization member permissions', () => {
|
|
|
467
467
|
}))).toEqual(true);
|
|
468
468
|
expect(ability.can('manage', subject('Space', {
|
|
469
469
|
organizationUuid: ORGANIZATION_EDITOR.organizationUuid,
|
|
470
|
-
|
|
470
|
+
inheritsFromOrgOrProject: false,
|
|
471
471
|
access: [
|
|
472
472
|
{
|
|
473
473
|
userUuid: ORGANIZATION_EDITOR.userUuid,
|
|
@@ -477,7 +477,7 @@ describe('Organization member permissions', () => {
|
|
|
477
477
|
}))).toEqual(false);
|
|
478
478
|
expect(ability.can('view', subject('Space', {
|
|
479
479
|
organizationUuid: ORGANIZATION_EDITOR.organizationUuid,
|
|
480
|
-
|
|
480
|
+
inheritsFromOrgOrProject: false,
|
|
481
481
|
access: [
|
|
482
482
|
{
|
|
483
483
|
userUuid: ORGANIZATION_EDITOR.userUuid,
|
|
@@ -487,7 +487,7 @@ describe('Organization member permissions', () => {
|
|
|
487
487
|
}))).toEqual(true);
|
|
488
488
|
expect(ability.can('manage', subject('Space', {
|
|
489
489
|
organizationUuid: ORGANIZATION_EDITOR.organizationUuid,
|
|
490
|
-
|
|
490
|
+
inheritsFromOrgOrProject: false,
|
|
491
491
|
access: [
|
|
492
492
|
{
|
|
493
493
|
userUuid: ORGANIZATION_EDITOR.userUuid,
|
|
@@ -497,7 +497,7 @@ describe('Organization member permissions', () => {
|
|
|
497
497
|
}))).toEqual(false);
|
|
498
498
|
expect(ability.can('manage', subject('Space', {
|
|
499
499
|
organizationUuid: ORGANIZATION_EDITOR.organizationUuid,
|
|
500
|
-
|
|
500
|
+
inheritsFromOrgOrProject: false,
|
|
501
501
|
access: [
|
|
502
502
|
{
|
|
503
503
|
userUuid: ORGANIZATION_EDITOR.userUuid,
|
|
@@ -509,14 +509,14 @@ describe('Organization member permissions', () => {
|
|
|
509
509
|
it('can manage public dashboards from their own organization', () => {
|
|
510
510
|
expect(ability.can('manage', subject('Dashboard', {
|
|
511
511
|
organizationUuid: '456',
|
|
512
|
-
|
|
512
|
+
inheritsFromOrgOrProject: true,
|
|
513
513
|
access: [],
|
|
514
514
|
}))).toEqual(false);
|
|
515
515
|
});
|
|
516
516
|
it('cannot manage public dashboards from another organization', () => {
|
|
517
517
|
expect(ability.can('manage', subject('Dashboard', {
|
|
518
518
|
organizationUuid: '789',
|
|
519
|
-
|
|
519
|
+
inheritsFromOrgOrProject: true,
|
|
520
520
|
access: [],
|
|
521
521
|
}))).toEqual(false);
|
|
522
522
|
});
|
|
@@ -695,25 +695,25 @@ describe('Organization member permissions', () => {
|
|
|
695
695
|
it('can only view public & accessable dashboards', () => {
|
|
696
696
|
expect(ability.can('view', subject('Dashboard', {
|
|
697
697
|
organizationUuid: ORGANIZATION_VIEWER.organizationUuid,
|
|
698
|
-
|
|
698
|
+
inheritsFromOrgOrProject: true,
|
|
699
699
|
}))).toEqual(true);
|
|
700
700
|
expect(ability.can('manage', subject('Dashboard', {
|
|
701
701
|
organizationUuid: ORGANIZATION_VIEWER.organizationUuid,
|
|
702
|
-
|
|
702
|
+
inheritsFromOrgOrProject: true,
|
|
703
703
|
}))).toEqual(false);
|
|
704
704
|
expect(ability.can('view', subject('Dashboard', {
|
|
705
705
|
organizationUuid: ORGANIZATION_VIEWER.organizationUuid,
|
|
706
|
-
|
|
706
|
+
inheritsFromOrgOrProject: false,
|
|
707
707
|
access: [],
|
|
708
708
|
}))).toEqual(false);
|
|
709
709
|
expect(ability.can('manage', subject('Dashboard', {
|
|
710
710
|
organizationUuid: ORGANIZATION_VIEWER.organizationUuid,
|
|
711
|
-
|
|
711
|
+
inheritsFromOrgOrProject: false,
|
|
712
712
|
access: [],
|
|
713
713
|
}))).toEqual(false);
|
|
714
714
|
expect(ability.can('view', subject('Dashboard', {
|
|
715
715
|
organizationUuid: ORGANIZATION_VIEWER.organizationUuid,
|
|
716
|
-
|
|
716
|
+
inheritsFromOrgOrProject: false,
|
|
717
717
|
access: [
|
|
718
718
|
{
|
|
719
719
|
userUuid: ORGANIZATION_VIEWER.userUuid,
|
|
@@ -723,7 +723,7 @@ describe('Organization member permissions', () => {
|
|
|
723
723
|
}))).toEqual(true);
|
|
724
724
|
expect(ability.can('manage', subject('Dashboard', {
|
|
725
725
|
organizationUuid: ORGANIZATION_VIEWER.organizationUuid,
|
|
726
|
-
|
|
726
|
+
inheritsFromOrgOrProject: false,
|
|
727
727
|
access: [
|
|
728
728
|
{
|
|
729
729
|
userUuid: ORGANIZATION_VIEWER.userUuid,
|
|
@@ -733,7 +733,7 @@ describe('Organization member permissions', () => {
|
|
|
733
733
|
}))).toEqual(false);
|
|
734
734
|
expect(ability.can('view', subject('Dashboard', {
|
|
735
735
|
organizationUuid: ORGANIZATION_VIEWER.organizationUuid,
|
|
736
|
-
|
|
736
|
+
inheritsFromOrgOrProject: false,
|
|
737
737
|
access: [
|
|
738
738
|
{
|
|
739
739
|
userUuid: ORGANIZATION_VIEWER.userUuid,
|
|
@@ -743,7 +743,7 @@ describe('Organization member permissions', () => {
|
|
|
743
743
|
}))).toEqual(true);
|
|
744
744
|
expect(ability.can('manage', subject('Dashboard', {
|
|
745
745
|
organizationUuid: ORGANIZATION_VIEWER.organizationUuid,
|
|
746
|
-
|
|
746
|
+
inheritsFromOrgOrProject: false,
|
|
747
747
|
access: [
|
|
748
748
|
{
|
|
749
749
|
userUuid: ORGANIZATION_VIEWER.userUuid,
|
|
@@ -755,25 +755,25 @@ describe('Organization member permissions', () => {
|
|
|
755
755
|
it('can view and manage public & accessable saved charts', () => {
|
|
756
756
|
expect(ability.can('view', subject('SavedChart', {
|
|
757
757
|
organizationUuid: ORGANIZATION_VIEWER.organizationUuid,
|
|
758
|
-
|
|
758
|
+
inheritsFromOrgOrProject: true,
|
|
759
759
|
}))).toEqual(true);
|
|
760
760
|
expect(ability.can('manage', subject('SavedChart', {
|
|
761
761
|
organizationUuid: ORGANIZATION_VIEWER.organizationUuid,
|
|
762
|
-
|
|
762
|
+
inheritsFromOrgOrProject: true,
|
|
763
763
|
}))).toEqual(false);
|
|
764
764
|
expect(ability.can('view', subject('SavedChart', {
|
|
765
765
|
organizationUuid: ORGANIZATION_VIEWER.organizationUuid,
|
|
766
|
-
|
|
766
|
+
inheritsFromOrgOrProject: false,
|
|
767
767
|
access: [],
|
|
768
768
|
}))).toEqual(false);
|
|
769
769
|
expect(ability.can('manage', subject('SavedChart', {
|
|
770
770
|
organizationUuid: ORGANIZATION_VIEWER.organizationUuid,
|
|
771
|
-
|
|
771
|
+
inheritsFromOrgOrProject: false,
|
|
772
772
|
access: [],
|
|
773
773
|
}))).toEqual(false);
|
|
774
774
|
expect(ability.can('view', subject('SavedChart', {
|
|
775
775
|
organizationUuid: ORGANIZATION_VIEWER.organizationUuid,
|
|
776
|
-
|
|
776
|
+
inheritsFromOrgOrProject: false,
|
|
777
777
|
access: [
|
|
778
778
|
{
|
|
779
779
|
userUuid: ORGANIZATION_VIEWER.userUuid,
|
|
@@ -783,7 +783,7 @@ describe('Organization member permissions', () => {
|
|
|
783
783
|
}))).toEqual(true);
|
|
784
784
|
expect(ability.can('manage', subject('SavedChart', {
|
|
785
785
|
organizationUuid: ORGANIZATION_VIEWER.organizationUuid,
|
|
786
|
-
|
|
786
|
+
inheritsFromOrgOrProject: false,
|
|
787
787
|
access: [
|
|
788
788
|
{
|
|
789
789
|
userUuid: ORGANIZATION_VIEWER.userUuid,
|
|
@@ -793,7 +793,7 @@ describe('Organization member permissions', () => {
|
|
|
793
793
|
}))).toEqual(false);
|
|
794
794
|
expect(ability.can('view', subject('SavedChart', {
|
|
795
795
|
organizationUuid: ORGANIZATION_VIEWER.organizationUuid,
|
|
796
|
-
|
|
796
|
+
inheritsFromOrgOrProject: false,
|
|
797
797
|
access: [
|
|
798
798
|
{
|
|
799
799
|
userUuid: ORGANIZATION_VIEWER.userUuid,
|
|
@@ -803,7 +803,7 @@ describe('Organization member permissions', () => {
|
|
|
803
803
|
}))).toEqual(true);
|
|
804
804
|
expect(ability.can('manage', subject('SavedChart', {
|
|
805
805
|
organizationUuid: ORGANIZATION_VIEWER.organizationUuid,
|
|
806
|
-
|
|
806
|
+
inheritsFromOrgOrProject: false,
|
|
807
807
|
access: [
|
|
808
808
|
{
|
|
809
809
|
userUuid: ORGANIZATION_VIEWER.userUuid,
|
|
@@ -815,25 +815,25 @@ describe('Organization member permissions', () => {
|
|
|
815
815
|
it('can view and manage public & accessable space', () => {
|
|
816
816
|
expect(ability.can('view', subject('Space', {
|
|
817
817
|
organizationUuid: ORGANIZATION_VIEWER.organizationUuid,
|
|
818
|
-
|
|
818
|
+
inheritsFromOrgOrProject: true,
|
|
819
819
|
}))).toEqual(true);
|
|
820
820
|
expect(ability.can('manage', subject('Space', {
|
|
821
821
|
organizationUuid: ORGANIZATION_VIEWER.organizationUuid,
|
|
822
|
-
|
|
822
|
+
inheritsFromOrgOrProject: true,
|
|
823
823
|
}))).toEqual(false);
|
|
824
824
|
expect(ability.can('view', subject('Space', {
|
|
825
825
|
organizationUuid: ORGANIZATION_VIEWER.organizationUuid,
|
|
826
|
-
|
|
826
|
+
inheritsFromOrgOrProject: false,
|
|
827
827
|
access: [],
|
|
828
828
|
}))).toEqual(false);
|
|
829
829
|
expect(ability.can('manage', subject('Space', {
|
|
830
830
|
organizationUuid: ORGANIZATION_VIEWER.organizationUuid,
|
|
831
|
-
|
|
831
|
+
inheritsFromOrgOrProject: false,
|
|
832
832
|
access: [],
|
|
833
833
|
}))).toEqual(false);
|
|
834
834
|
expect(ability.can('view', subject('Space', {
|
|
835
835
|
organizationUuid: ORGANIZATION_VIEWER.organizationUuid,
|
|
836
|
-
|
|
836
|
+
inheritsFromOrgOrProject: false,
|
|
837
837
|
access: [
|
|
838
838
|
{
|
|
839
839
|
userUuid: ORGANIZATION_VIEWER.userUuid,
|
|
@@ -843,7 +843,7 @@ describe('Organization member permissions', () => {
|
|
|
843
843
|
}))).toEqual(true);
|
|
844
844
|
expect(ability.can('manage', subject('Space', {
|
|
845
845
|
organizationUuid: ORGANIZATION_VIEWER.organizationUuid,
|
|
846
|
-
|
|
846
|
+
inheritsFromOrgOrProject: false,
|
|
847
847
|
access: [
|
|
848
848
|
{
|
|
849
849
|
userUuid: ORGANIZATION_VIEWER.userUuid,
|
|
@@ -853,7 +853,7 @@ describe('Organization member permissions', () => {
|
|
|
853
853
|
}))).toEqual(false);
|
|
854
854
|
expect(ability.can('view', subject('Space', {
|
|
855
855
|
organizationUuid: ORGANIZATION_VIEWER.organizationUuid,
|
|
856
|
-
|
|
856
|
+
inheritsFromOrgOrProject: false,
|
|
857
857
|
access: [
|
|
858
858
|
{
|
|
859
859
|
userUuid: ORGANIZATION_VIEWER.userUuid,
|
|
@@ -863,7 +863,7 @@ describe('Organization member permissions', () => {
|
|
|
863
863
|
}))).toEqual(true);
|
|
864
864
|
expect(ability.can('manage', subject('Space', {
|
|
865
865
|
organizationUuid: ORGANIZATION_VIEWER.organizationUuid,
|
|
866
|
-
|
|
866
|
+
inheritsFromOrgOrProject: false,
|
|
867
867
|
access: [
|
|
868
868
|
{
|
|
869
869
|
userUuid: ORGANIZATION_VIEWER.userUuid,
|
|
@@ -952,7 +952,10 @@ describe('Organization member permissions', () => {
|
|
|
952
952
|
expect(ability.can('view', subject('Organization', org))).toEqual(false);
|
|
953
953
|
});
|
|
954
954
|
it('can view dashboards from their own organization', () => {
|
|
955
|
-
const org = {
|
|
955
|
+
const org = {
|
|
956
|
+
organizationUuid: '456',
|
|
957
|
+
inheritsFromOrgOrProject: true,
|
|
958
|
+
};
|
|
956
959
|
expect(ability.can('view', subject('Dashboard', org))).toEqual(true);
|
|
957
960
|
});
|
|
958
961
|
it('cannot view dashboards from another organization', () => {
|
|
@@ -961,13 +964,13 @@ describe('Organization member permissions', () => {
|
|
|
961
964
|
it('can view savedCharts from their own organization', () => {
|
|
962
965
|
expect(ability.can('view', subject('SavedChart', {
|
|
963
966
|
organizationUuid: '456',
|
|
964
|
-
|
|
967
|
+
inheritsFromOrgOrProject: true,
|
|
965
968
|
}))).toEqual(true);
|
|
966
969
|
});
|
|
967
970
|
it('cannot view savedCharts from another organization', () => {
|
|
968
971
|
expect(ability.can('view', subject('SavedChart', {
|
|
969
972
|
organizationUuid: '789',
|
|
970
|
-
|
|
973
|
+
inheritsFromOrgOrProject: true,
|
|
971
974
|
}))).toEqual(false);
|
|
972
975
|
});
|
|
973
976
|
it('can view projects from their own organization', () => {
|
|
@@ -1127,25 +1130,28 @@ describe('Organization member permissions', () => {
|
|
|
1127
1130
|
expect(ability.can('view', subject('Organization', org))).toEqual(false);
|
|
1128
1131
|
});
|
|
1129
1132
|
it('can view dashboards from their own organization', () => {
|
|
1130
|
-
const org = {
|
|
1133
|
+
const org = {
|
|
1134
|
+
organizationUuid: '456',
|
|
1135
|
+
inheritsFromOrgOrProject: true,
|
|
1136
|
+
};
|
|
1131
1137
|
expect(ability.can('view', subject('Dashboard', org))).toEqual(true);
|
|
1132
1138
|
});
|
|
1133
1139
|
it('cannot view dashboards from another organization', () => {
|
|
1134
1140
|
expect(ability.can('view', subject('Dashboard', {
|
|
1135
1141
|
organizationUuid: '789',
|
|
1136
|
-
|
|
1142
|
+
inheritsFromOrgOrProject: true,
|
|
1137
1143
|
}))).toEqual(false);
|
|
1138
1144
|
});
|
|
1139
1145
|
it('can view savedCharts from their own organization', () => {
|
|
1140
1146
|
expect(ability.can('view', subject('SavedChart', {
|
|
1141
1147
|
organizationUuid: '456',
|
|
1142
|
-
|
|
1148
|
+
inheritsFromOrgOrProject: true,
|
|
1143
1149
|
}))).toEqual(true);
|
|
1144
1150
|
});
|
|
1145
1151
|
it('cannot view savedCharts from another organization', () => {
|
|
1146
1152
|
expect(ability.can('view', subject('SavedChart', {
|
|
1147
1153
|
organizationUuid: '789',
|
|
1148
|
-
|
|
1154
|
+
inheritsFromOrgOrProject: true,
|
|
1149
1155
|
}))).toEqual(false);
|
|
1150
1156
|
});
|
|
1151
1157
|
it('can view projects from their own organization', () => {
|