@appxdigital/appx-core 0.1.121-beta.6 → 0.1.121-beta.7
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/PRERELEASES.md
CHANGED
|
@@ -23,6 +23,17 @@ Prereleases are excluded from normal semver range resolution, so a project on
|
|
|
23
23
|
|
|
24
24
|
---
|
|
25
25
|
|
|
26
|
+
## [0.1.121-beta.7] — unreleased
|
|
27
|
+
|
|
28
|
+
**Library.** `createMany` now inherits the `create` permission when not declared
|
|
29
|
+
explicitly — in both the data-access proxy and the `RbacGuard`. A
|
|
30
|
+
`permissions.config.ts` can declare a single `create` rule and have it cover
|
|
31
|
+
`createMany` too (mirrors the existing `findMany → count/findFirst` fallback).
|
|
32
|
+
One-directional: declaring only `createMany` does **not** enable `create`.
|
|
33
|
+
|
|
34
|
+
- If you previously duplicated `create` and `createMany`, the `createMany` entry
|
|
35
|
+
is now redundant (harmless to keep). No action required.
|
|
36
|
+
|
|
26
37
|
## [0.1.121-beta.6] — unreleased
|
|
27
38
|
|
|
28
39
|
**Packaging.** The npm tarball now ships `CHANGELOG.md`, `PRERELEASES.md`, and
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rbac.guard.d.ts","sourceRoot":"","sources":["../../../src/common/guards/rbac.guard.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,WAAW,EACX,gBAAgB,EAInB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAGvC,OAAO,EAAC,qBAAqB,EAAkB,MAAM,kCAAkC,CAAC;AAExF,qBACa,SAAU,YAAW,WAAW;IAErC,OAAO,CAAC,SAAS;IACiB,OAAO,CAAC,iBAAiB;gBADnD,SAAS,EAAE,SAAS,EACc,iBAAiB,EAAE,qBAAqB;IAGhF,WAAW,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"rbac.guard.d.ts","sourceRoot":"","sources":["../../../src/common/guards/rbac.guard.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,WAAW,EACX,gBAAgB,EAInB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAGvC,OAAO,EAAC,qBAAqB,EAAkB,MAAM,kCAAkC,CAAC;AAExF,qBACa,SAAU,YAAW,WAAW;IAErC,OAAO,CAAC,SAAS;IACiB,OAAO,CAAC,iBAAiB;gBADnD,SAAS,EAAE,SAAS,EACc,iBAAiB,EAAE,qBAAqB;IAGhF,WAAW,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,OAAO,CAAC;CA0CjE"}
|
|
@@ -38,7 +38,13 @@ let RbacGuard = exports.RbacGuard = class RbacGuard {
|
|
|
38
38
|
if (!rolePermissions) {
|
|
39
39
|
throw new common_1.ForbiddenException(`No permissions defined for role ${user.role} on model ${model}`);
|
|
40
40
|
}
|
|
41
|
-
|
|
41
|
+
// `createMany` inherits the `create` rule when not defined explicitly —
|
|
42
|
+
// mirrors the data-access proxy, which validates each batched row against
|
|
43
|
+
// the `create` permission. Lets a config declare just `create`.
|
|
44
|
+
let permission = rolePermissions[action];
|
|
45
|
+
if (!permission && action === 'createMany') {
|
|
46
|
+
permission = rolePermissions['create'];
|
|
47
|
+
}
|
|
42
48
|
if (!permission) {
|
|
43
49
|
throw new common_1.ForbiddenException(`Action ${action} not allowed for role ${user.role} on model ${model}`);
|
|
44
50
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@appxdigital/appx-core",
|
|
3
|
-
"version": "0.1.121-beta.
|
|
3
|
+
"version": "0.1.121-beta.7",
|
|
4
4
|
"description": "Appx Core is a library that provides a set of tools to help you build your application faster.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|