@live-change/access-control-service 0.9.44 → 0.9.45
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/indexes.js +9 -15
- package/package.json +3 -3
package/indexes.js
CHANGED
|
@@ -559,9 +559,6 @@ if(config.indexed) {
|
|
|
559
559
|
},
|
|
560
560
|
...App.rangeProperties
|
|
561
561
|
},
|
|
562
|
-
access({ }, { client }) {
|
|
563
|
-
return client.roles.includes('admin')
|
|
564
|
-
},
|
|
565
562
|
daoPath(params, { client, service }, method) {
|
|
566
563
|
const [ sessionOrUserType, sessionOrUser ] = client.user
|
|
567
564
|
? ['user_User', client.user] : ['session_Session', client.session]
|
|
@@ -569,10 +566,14 @@ if(config.indexed) {
|
|
|
569
566
|
const range = App.extractRange(params)
|
|
570
567
|
if(!range.limit || range.limit > 1000) range.limit = 1000
|
|
571
568
|
if(objectType) {
|
|
569
|
+
console.log("PATH", roleByOwnerAndObjectIndex.rangePath(
|
|
570
|
+
[sessionOrUserType, sessionOrUser, objectType],
|
|
571
|
+
range
|
|
572
|
+
))
|
|
572
573
|
return roleByOwnerAndObjectIndex.rangePath(
|
|
573
574
|
[sessionOrUserType, sessionOrUser, objectType],
|
|
574
575
|
range
|
|
575
|
-
)
|
|
576
|
+
)
|
|
576
577
|
} else {
|
|
577
578
|
return ownerByObjectAndRoleIndex.rangePath(
|
|
578
579
|
[sessionOrUserType, sessionOrUser],
|
|
@@ -590,9 +591,6 @@ if(config.indexed) {
|
|
|
590
591
|
},
|
|
591
592
|
...App.rangeProperties
|
|
592
593
|
},
|
|
593
|
-
access({ }, { client }) {
|
|
594
|
-
return client.roles.includes('admin')
|
|
595
|
-
},
|
|
596
594
|
daoPath(params, { client, service }, method) {
|
|
597
595
|
const [ sessionOrUserType, sessionOrUser ] = client.user
|
|
598
596
|
? ['user_User', client.user] : ['session_Session', client.session]
|
|
@@ -708,9 +706,6 @@ if(config.indexed) {
|
|
|
708
706
|
},
|
|
709
707
|
...App.rangeProperties
|
|
710
708
|
},
|
|
711
|
-
access({ }, { client }) {
|
|
712
|
-
return client.roles.includes('admin')
|
|
713
|
-
},
|
|
714
709
|
daoPath(params, { client, service }, method) {
|
|
715
710
|
const [ sessionOrUserType, sessionOrUser ] = client.user
|
|
716
711
|
? ['user_User', client.user] : ['session_Session', client.session]
|
|
@@ -743,9 +738,6 @@ if(config.indexed) {
|
|
|
743
738
|
},
|
|
744
739
|
...App.rangeProperties
|
|
745
740
|
},
|
|
746
|
-
access({ }, { client }) {
|
|
747
|
-
return client.roles.includes('admin')
|
|
748
|
-
},
|
|
749
741
|
daoPath(params, { client, service }, method) {
|
|
750
742
|
const [ sessionOrUserType, sessionOrUser ] = client.user
|
|
751
743
|
? ['user_User', client.user] : ['session_Session', client.session]
|
|
@@ -792,7 +784,8 @@ if(config.indexed) {
|
|
|
792
784
|
},
|
|
793
785
|
...App.rangeProperties
|
|
794
786
|
},
|
|
795
|
-
access({ objectType, object }, { client }) {
|
|
787
|
+
access({ objectType, object }, { client, visibilityTest }) {
|
|
788
|
+
if(visibilityTest) return true
|
|
796
789
|
if(client.roles.includes('admin')) return true
|
|
797
790
|
return isObjectRole(client, objectType, object, 'owner')
|
|
798
791
|
},
|
|
@@ -827,7 +820,8 @@ if(config.indexed) {
|
|
|
827
820
|
},
|
|
828
821
|
...App.rangeProperties
|
|
829
822
|
},
|
|
830
|
-
access({ }, { client }) {
|
|
823
|
+
access({ objectType, object }, { client, visibilityTest }) {
|
|
824
|
+
if(visibilityTest) return true
|
|
831
825
|
if(client.roles.includes('admin')) return true
|
|
832
826
|
return isObjectRole(client, objectType, object, 'owner')
|
|
833
827
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@live-change/access-control-service",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.45",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
"url": "https://www.viamage.com/"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@live-change/framework": "^0.9.
|
|
24
|
+
"@live-change/framework": "^0.9.45"
|
|
25
25
|
},
|
|
26
|
-
"gitHead": "
|
|
26
|
+
"gitHead": "cc49c034ca5538efdb5c43d87041367d39a3d63f",
|
|
27
27
|
"type": "module"
|
|
28
28
|
}
|