@things-factory/dataset 7.1.38 → 7.1.47

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@things-factory/dataset",
3
- "version": "7.1.38",
3
+ "version": "7.1.47",
4
4
  "main": "dist-server/index.js",
5
5
  "browser": "dist-client/index.js",
6
6
  "things-factory": true,
@@ -40,21 +40,21 @@
40
40
  "@operato/shell": "^7.0.0",
41
41
  "@operato/styles": "^7.0.0",
42
42
  "@operato/utils": "^7.0.0",
43
- "@things-factory/auth-base": "^7.1.33",
44
- "@things-factory/aws-base": "^7.1.33",
45
- "@things-factory/board-service": "^7.1.34",
43
+ "@things-factory/auth-base": "^7.1.47",
44
+ "@things-factory/aws-base": "^7.1.47",
45
+ "@things-factory/board-service": "^7.1.47",
46
46
  "@things-factory/env": "^7.1.16",
47
- "@things-factory/integration-base": "^7.1.34",
48
- "@things-factory/organization": "^7.1.33",
49
- "@things-factory/personalization": "^7.1.33",
50
- "@things-factory/scheduler-client": "^7.1.34",
51
- "@things-factory/shell": "^7.1.24",
52
- "@things-factory/work-shift": "^7.1.33",
53
- "@things-factory/worklist": "^7.1.37",
47
+ "@things-factory/integration-base": "^7.1.47",
48
+ "@things-factory/organization": "^7.1.47",
49
+ "@things-factory/personalization": "^7.1.47",
50
+ "@things-factory/scheduler-client": "^7.1.47",
51
+ "@things-factory/shell": "^7.1.47",
52
+ "@things-factory/work-shift": "^7.1.47",
53
+ "@things-factory/worklist": "^7.1.47",
54
54
  "cron-parser": "^4.3.0",
55
55
  "moment-timezone": "^0.5.45",
56
56
  "simple-statistics": "^7.8.3",
57
57
  "statistics": "^3.3.0"
58
58
  },
59
- "gitHead": "235f5fc6b16418cfe2ab86aa346394bde1a7969b"
59
+ "gitHead": "2d63d16d4d974193802a0c23b6794061d2ba4bd2"
60
60
  }
@@ -30,7 +30,7 @@ async function callback(
30
30
  const corrector = activityThreads[0]?.assignee
31
31
 
32
32
  const { dataOocId } = input
33
- const correctiveAction = output.action
33
+ const correctiveAction = output?.action
34
34
 
35
35
  var dataOoc = await tx.getRepository(DataOoc).findOne({
36
36
  where: {
@@ -243,14 +243,15 @@ export class DataSetMutation {
243
243
  }
244
244
  })
245
245
 
246
- const { supervisoryRoleId } = dataSet
246
+ const { supervisoryRoleId, entryRoleId } = dataSet
247
+ const allowedRoles = [supervisoryRoleId, entryRoleId].filter(Boolean)
247
248
 
248
249
  const me = await getRepository(User, tx).findOne({
249
250
  where: { id: user.id },
250
251
  relations: ['roles']
251
252
  })
252
253
 
253
- if (!me.roles.find(role => role.id == supervisoryRoleId)) {
254
+ if (!me.roles.find(role => allowedRoles.includes(role.id))) {
254
255
  throw new Error(`You don't have permission to issue data collection task for this dataset.`)
255
256
  }
256
257