adapt-authoring-roles 1.3.2 → 1.3.4
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/lib/RolesModule.js
CHANGED
|
@@ -41,7 +41,7 @@ class RolesModule extends AbstractApiModule {
|
|
|
41
41
|
return
|
|
42
42
|
}
|
|
43
43
|
try {
|
|
44
|
-
await this.insert(r)
|
|
44
|
+
await this.insert(r, { validate: false })
|
|
45
45
|
this.log('debug', 'INSERT', this.schemaName, r.shortName)
|
|
46
46
|
} catch (e) {
|
|
47
47
|
if (e.code !== 11000) this.log('warn', `failed to add '${r.shortName}' role, ${e.message}`)
|
|
@@ -56,6 +56,7 @@ class RolesModule extends AbstractApiModule {
|
|
|
56
56
|
async shortNamesToIds (roles) {
|
|
57
57
|
return Promise.all(roles.map(async r => {
|
|
58
58
|
const [role] = await this.find({ shortName: r })
|
|
59
|
+
if (!role) throw new Error(`role '${r}' not found`)
|
|
59
60
|
return role._id.toString()
|
|
60
61
|
}))
|
|
61
62
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "adapt-authoring-roles",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.4",
|
|
4
4
|
"description": "Module for managing user roles",
|
|
5
5
|
"homepage": "https://github.com/adapt-security/adapt-authoring-roles",
|
|
6
6
|
"license": "GPL-3.0",
|
|
@@ -47,27 +47,10 @@
|
|
|
47
47
|
"adapt-authoring-api": "^2.0.0"
|
|
48
48
|
},
|
|
49
49
|
"peerDependencies": {
|
|
50
|
-
"adapt-authoring-auth": "^
|
|
51
|
-
"adapt-authoring-auth-local": "^
|
|
50
|
+
"adapt-authoring-auth": "^2.0.0",
|
|
51
|
+
"adapt-authoring-auth-local": "^2.0.0",
|
|
52
52
|
"adapt-authoring-core": "^2.0.0",
|
|
53
53
|
"adapt-authoring-mongodb": "^2.0.0",
|
|
54
54
|
"adapt-authoring-users": "^1.0.2"
|
|
55
|
-
},
|
|
56
|
-
"peerDependenciesMeta": {
|
|
57
|
-
"adapt-authoring-auth": {
|
|
58
|
-
"optional": true
|
|
59
|
-
},
|
|
60
|
-
"adapt-authoring-auth-local": {
|
|
61
|
-
"optional": true
|
|
62
|
-
},
|
|
63
|
-
"adapt-authoring-core": {
|
|
64
|
-
"optional": true
|
|
65
|
-
},
|
|
66
|
-
"adapt-authoring-mongodb": {
|
|
67
|
-
"optional": true
|
|
68
|
-
},
|
|
69
|
-
"adapt-authoring-users": {
|
|
70
|
-
"optional": true
|
|
71
|
-
}
|
|
72
55
|
}
|
|
73
56
|
}
|