@live-change/framework 0.8.8 → 0.8.10

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/App.js CHANGED
@@ -181,8 +181,8 @@ class App {
181
181
  this.startedServices[serviceDefinition.name] = service
182
182
 
183
183
  for(const viewName in serviceDefinition.views) {
184
- const view = serviceDefinition.views[viewName]
185
- if(view.global) this.globalViews[viewName] = view
184
+ const viewDefinition = serviceDefinition.views[viewName]
185
+ if(viewDefinition.global) this.globalViews[viewName] = service.views[viewName]
186
186
  }
187
187
 
188
188
  return service
@@ -579,7 +579,7 @@ class App {
579
579
  async viewGet(viewName, params) {
580
580
  const view = this.globalViews[viewName]
581
581
  if(!view) throw new Error(`Global view ${viewName} not found`)
582
- return await view.get(params)
582
+ return await view.get(params, { internal: true, roles: ['admin'] })
583
583
  }
584
584
 
585
585
  }
@@ -22,6 +22,10 @@ export default async function(service, definition, app, client) {
22
22
 
23
23
  for(let viewName in definition.views) {
24
24
  const view = service.definition.views[viewName]
25
+ if(view.internal &&
26
+ !(client.roles.includes('admin') || client.roles.includes('administrator'))) {
27
+ delete definition.views[viewName]
28
+ }
25
29
  if(!view.access) continue;
26
30
  let access = getAccessMethod(view.access)
27
31
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@live-change/framework",
3
- "version": "0.8.8",
3
+ "version": "0.8.10",
4
4
  "description": "Live Change Framework - ultimate solution for real time mobile/web apps",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -22,8 +22,8 @@
22
22
  },
23
23
  "homepage": "https://github.com/live-change/live-change-framework",
24
24
  "devDependencies": {
25
- "@live-change/dao": "^0.8.8",
26
- "@live-change/uid": "^0.8.8"
25
+ "@live-change/dao": "^0.8.10",
26
+ "@live-change/uid": "^0.8.10"
27
27
  },
28
- "gitHead": "77eafa414e091c8d34ae63ee8927d53f3bde893d"
28
+ "gitHead": "b6d6d60903abd25c8da4a55f653aafafb6cf04f7"
29
29
  }