@apso/cli 0.45.0 → 0.45.2
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.
|
@@ -324,7 +324,10 @@ export class ScopeGuard implements CanActivate {
|
|
|
324
324
|
request[contextKey] ||
|
|
325
325
|
request.user?.[contextKey] ||
|
|
326
326
|
request.scope?.[contextKey] ||
|
|
327
|
-
request.context?.[contextKey]
|
|
327
|
+
request.context?.[contextKey]<% if (it.hasAuth) { %> ||
|
|
328
|
+
// A scope field with another name (orgId, tenantId) is the caller's tenant.
|
|
329
|
+
request.auth?.[contextKey] ||
|
|
330
|
+
request.auth?.workspaceId<% } %>
|
|
328
331
|
);
|
|
329
332
|
}
|
|
330
333
|
|
|
@@ -56,12 +56,12 @@ import {<%= it.svcName %>} from './<%= it.entityName %>.service';
|
|
|
56
56
|
@CrudAuth({
|
|
57
57
|
filter: (req: any) => ({
|
|
58
58
|
<% it.crudAuth.forEach((s) => { %>
|
|
59
|
-
<%= s.field %>: req.<%= s.contextKey %> ?? req.user?.<%= s.contextKey
|
|
59
|
+
<%= s.field %>: req.<%= s.contextKey %> ?? req.user?.<%= s.contextKey %> ?? req.auth?.<%= s.contextKey %> ?? req.auth?.workspaceId,
|
|
60
60
|
<% }) %>
|
|
61
61
|
}),
|
|
62
62
|
persist: (req: any) => ({
|
|
63
63
|
<% it.crudAuth.forEach((s) => { %>
|
|
64
|
-
<%= s.field %>: req.<%= s.contextKey %> ?? req.user?.<%= s.contextKey
|
|
64
|
+
<%= s.field %>: req.<%= s.contextKey %> ?? req.user?.<%= s.contextKey %> ?? req.auth?.<%= s.contextKey %> ?? req.auth?.workspaceId,
|
|
65
65
|
<% }) %>
|
|
66
66
|
}),
|
|
67
67
|
})
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@apso/cli",
|
|
3
|
-
"version": "0.45.
|
|
3
|
+
"version": "0.45.2",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@apso/cli",
|
|
9
|
-
"version": "0.45.
|
|
9
|
+
"version": "0.45.2",
|
|
10
10
|
"license": "Apache-2.0",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@apso/schema-tools": "^0.2.0",
|
package/oclif.manifest.json
CHANGED