not-node 6.4.4 → 6.4.5
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 +1 -1
- package/src/auth/rules.js +1 -1
- package/src/core/safety.protocols.js +21 -1
package/package.json
CHANGED
package/src/auth/rules.js
CHANGED
|
@@ -94,7 +94,7 @@ function compareAuthStatus(rule, auth) {
|
|
|
94
94
|
* Check rule against presented credentials
|
|
95
95
|
* @param {import('../types').notRouteRule} rule action rule
|
|
96
96
|
* @param {boolean} auth user state of auth
|
|
97
|
-
* @param {string|Array<string>}
|
|
97
|
+
* @param {string|Array<string>} role user state of role
|
|
98
98
|
* @param {boolean} root user state of root
|
|
99
99
|
* @return {boolean} pass or not
|
|
100
100
|
*/
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
const { ACTION_SIGNATURES } = require("../auth/const");
|
|
2
|
-
|
|
2
|
+
/**
|
|
3
|
+
* owner can manage own documents
|
|
4
|
+
* root, admin - any own and any of client, user, guest
|
|
5
|
+
*/
|
|
3
6
|
module.exports.ownerRootAdmin = Object.freeze({
|
|
4
7
|
[ACTION_SIGNATURES.CREATE]: ["@owner", "root", "admin"],
|
|
5
8
|
[ACTION_SIGNATURES.READ]: ["@owner", "root", "admin"],
|
|
@@ -7,6 +10,20 @@ module.exports.ownerRootAdmin = Object.freeze({
|
|
|
7
10
|
[ACTION_SIGNATURES.DELETE]: ["@owner", "root", "admin"],
|
|
8
11
|
});
|
|
9
12
|
|
|
13
|
+
/**
|
|
14
|
+
* same as above but client can create new documents
|
|
15
|
+
*/
|
|
16
|
+
module.exports.ownerRootAdminCRUD_clientC = Object.freeze({
|
|
17
|
+
[ACTION_SIGNATURES.CREATE]: ["@owner", "root", "admin", "client"],
|
|
18
|
+
[ACTION_SIGNATURES.READ]: ["@owner", "root", "admin"],
|
|
19
|
+
[ACTION_SIGNATURES.UPDATE]: ["@owner", "root", "admin"],
|
|
20
|
+
[ACTION_SIGNATURES.DELETE]: ["@owner", "root", "admin"],
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* system creates some docs maybe with ownage delegated to other user
|
|
25
|
+
* owner, root, admin could read
|
|
26
|
+
*/
|
|
10
27
|
module.exports.systemManageable = Object.freeze({
|
|
11
28
|
[ACTION_SIGNATURES.CREATE]: ["@system"],
|
|
12
29
|
[ACTION_SIGNATURES.READ]: ["@system", "@owner", "root", "admin"],
|
|
@@ -14,6 +31,9 @@ module.exports.systemManageable = Object.freeze({
|
|
|
14
31
|
[ACTION_SIGNATURES.DELETE]: ["@system"],
|
|
15
32
|
});
|
|
16
33
|
|
|
34
|
+
/**
|
|
35
|
+
* anyone could read, public readable data
|
|
36
|
+
*/
|
|
17
37
|
module.exports.publicReadable = Object.freeze({
|
|
18
38
|
[ACTION_SIGNATURES.CREATE]: [],
|
|
19
39
|
[ACTION_SIGNATURES.READ]: ["@*"],
|