@lightdash/cli 0.3420.1 → 0.3420.3

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.
@@ -92,14 +92,16 @@ const getContentAsCodeUploadPermissions = async (projectUuid) => {
92
92
  }),
93
93
  ]);
94
94
  const ability = new ability_1.Ability(user.abilityRules);
95
- if (ability.cannot('manage', (0, ability_1.subject)('ContentAsCode', {
95
+ const contentAsCodeSubject = (0, ability_1.subject)('ContentAsCode', {
96
96
  organizationUuid: project.organizationUuid,
97
97
  projectUuid: project.projectUuid,
98
98
  upstreamProjectUuid: project.upstreamProjectUuid,
99
99
  type: project.type,
100
100
  createdByUserUuid: project.createdByUserUuid,
101
- }))) {
102
- throw new common_1.ForbiddenError(`You don't have permission to upload content as code to project "${project.name}". The manage:ContentAsCode permission is required.`);
101
+ });
102
+ if (ability.cannot('create', contentAsCodeSubject) &&
103
+ ability.cannot('manage', contentAsCodeSubject)) {
104
+ throw new common_1.ForbiddenError(`You don't have permission to upload content as code to project "${project.name}". The create:ContentAsCode or manage:ContentAsCode permission is required.`);
103
105
  }
104
106
  const baseSubject = {
105
107
  organizationUuid: project.organizationUuid,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lightdash/cli",
3
- "version": "0.3420.1",
3
+ "version": "0.3420.3",
4
4
  "description": "Lightdash CLI tool",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -41,8 +41,8 @@
41
41
  "unique-names-generator": "4.7.1",
42
42
  "uuid": "11.1.1",
43
43
  "yaml": "2.8.3",
44
- "@lightdash/warehouses": "0.3420.1",
45
- "@lightdash/common": "0.3420.1"
44
+ "@lightdash/common": "0.3420.3",
45
+ "@lightdash/warehouses": "0.3420.3"
46
46
  },
47
47
  "devDependencies": {
48
48
  "@types/inquirer": "8.2.4",