@live-change/access-control-service 0.8.83 → 0.8.85

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.
Files changed (3) hide show
  1. package/model.js +4 -1
  2. package/package.json +3 -3
  3. package/view.js +49 -1
package/model.js CHANGED
@@ -116,7 +116,10 @@ const AccessInvitation = definition.model({
116
116
  }
117
117
  },
118
118
  indexes: {
119
-
119
+ byOwnerRoleAndObject: {
120
+ property: ['contactOrUserType', 'contactOrUser', 'roles', 'objectType', 'object'],
121
+ multi: true
122
+ }
120
123
  }
121
124
  })
122
125
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@live-change/access-control-service",
3
- "version": "0.8.83",
3
+ "version": "0.8.85",
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.8.83"
24
+ "@live-change/framework": "^0.8.85"
25
25
  },
26
- "gitHead": "a3c85f0869b4c65c2bdd6f181bdfcbe2d6f2bde5",
26
+ "gitHead": "1f07885a23183da611b39c2e729b4e704cdcd0ee",
27
27
  "type": "module"
28
28
  }
package/view.js CHANGED
@@ -5,7 +5,7 @@ const app = App.app()
5
5
  import accessModule from './access.js'
6
6
  const access = accessModule(definition)
7
7
 
8
- import { Access } from './model.js'
8
+ import { Access, AccessInvitation } from './model.js'
9
9
 
10
10
  definition.view({
11
11
  name: "myAccessTo",
@@ -121,3 +121,51 @@ definition.view({
121
121
  [sessionOrUserType, sessionOrUser, role, objectType], App.extractRange(properties))
122
122
  }
123
123
  })
124
+
125
+ definition.view({
126
+ name: 'myAccessInvitationsByObjectType',
127
+ properties: {
128
+ objectType: {
129
+ type: String
130
+ },
131
+ ...App.rangeProperties
132
+ },
133
+ returns: {
134
+ type: Array,
135
+ of: {
136
+ type: Access
137
+ }
138
+ },
139
+ async daoPath(properties, { client, service }, method) {
140
+ const [ sessionOrUserType, sessionOrUser ] =
141
+ client.user ? ['user_User', client.user] : ['session_Session', client.session]
142
+ const { objectType } = properties
143
+ return AccessInvitation.rangePath([sessionOrUserType, sessionOrUser, objectType], App.extractRange(properties))
144
+ }
145
+ })
146
+
147
+ definition.view({
148
+ name: 'myAccessInvitationsByObjectTypeAndRole',
149
+ properties: {
150
+ objectType: {
151
+ type: String
152
+ },
153
+ role: {
154
+ type: String
155
+ },
156
+ ...App.rangeProperties
157
+ },
158
+ returns: {
159
+ type: Array,
160
+ of: {
161
+ type: Access
162
+ }
163
+ },
164
+ async daoPath(properties, { client, service }, method) {
165
+ const [ sessionOrUserType, sessionOrUser ] =
166
+ client.user ? ['user_User', client.user] : ['session_Session', client.session]
167
+ const { objectType, role } = properties
168
+ return AccessInvitation.indexRangePath('byOwnerRoleAndObject',
169
+ [sessionOrUserType, sessionOrUser, role, objectType], App.extractRange(properties))
170
+ }
171
+ })