@contember/schema-definition
Advanced tools
Comparing version 0.9.2-alpha.7 to 0.9.2
@@ -19,3 +19,2 @@ import EntitySelector from './EntitySelector'; | ||
allowDelete(predicate?: Acl.Predicate): EntityPermissionsBuilder; | ||
allowCustomPrimary(): EntityPermissionsBuilder; | ||
private updateAll; | ||
@@ -22,0 +21,0 @@ private addEntityPermission; |
@@ -44,5 +44,2 @@ "use strict"; | ||
} | ||
allowCustomPrimary() { | ||
return this.addEntityPermission(() => ({ operations: { customPrimary: true }, predicates: {} })); | ||
} | ||
updateAll(operations, predicate) { | ||
@@ -49,0 +46,0 @@ return this.addEntityPermission(entity => { |
@@ -16,3 +16,2 @@ "use strict"; | ||
overrideEntityPermissions(original, overrides) { | ||
var _a, _b; | ||
return { | ||
@@ -24,12 +23,7 @@ predicates: { ...original.predicates, ...overrides.predicates }, | ||
update: { ...(original.operations.update || {}), ...(overrides.operations.update || {}) }, | ||
...(original.operations.delete === undefined && overrides.operations.delete === undefined | ||
...(overrides.operations.delete === undefined | ||
? {} | ||
: { | ||
delete: (_a = overrides.operations.delete) !== null && _a !== void 0 ? _a : original.operations.delete, | ||
delete: overrides.operations.delete, | ||
}), | ||
...(original.operations.customPrimary === undefined && overrides.operations.customPrimary === undefined | ||
? {} | ||
: { | ||
customPrimary: (_b = overrides.operations.customPrimary) !== null && _b !== void 0 ? _b : original.operations.customPrimary, | ||
}), | ||
}, | ||
@@ -36,0 +30,0 @@ }; |
@@ -13,3 +13,2 @@ import { Acl, Model } from '@contember/schema'; | ||
allow(operations: Acl.Operation[]): PermissionsBuilder; | ||
allowCustomPrimary(): PermissionsBuilder; | ||
add(permissions: Acl.Permissions): PermissionsBuilder; | ||
@@ -16,0 +15,0 @@ onEntity(entitySelector: EntitySelector | string | string[]): EntityPermissionsBuilder; |
@@ -25,5 +25,2 @@ "use strict"; | ||
} | ||
allowCustomPrimary() { | ||
return this.onEveryEntity().allowCustomPrimary().builder; | ||
} | ||
add(permissions) { | ||
@@ -30,0 +27,0 @@ const overrider = new PermissionOverrider_1.default(); |
{ | ||
"name": "@contember/schema-definition", | ||
"version": "0.9.2-alpha.7", | ||
"version": "0.9.2", | ||
"license": "Apache-2.0", | ||
"main": "dist/src/index.js", | ||
"typings": "dist/src/index.d.ts", | ||
"scripts": { | ||
"test": "echo 'No tests'" | ||
}, | ||
"scripts": {}, | ||
"dependencies": { | ||
"@contember/schema": "^0.9.2-alpha.7", | ||
"@contember/schema-utils": "^0.9.2-alpha.7", | ||
"@contember/schema": "^0.9.2", | ||
"@contember/schema-utils": "^0.9.2", | ||
"reflect-metadata": "^0.1.13" | ||
@@ -14,0 +12,0 @@ }, |
@@ -58,6 +58,2 @@ import { tuple } from '../utils' | ||
allowCustomPrimary(): EntityPermissionsBuilder { | ||
return this.addEntityPermission(() => ({ operations: { customPrimary: true }, predicates: {} })) | ||
} | ||
private updateAll(operations: Acl.Operation[], predicate: Acl.Predicate): EntityPermissionsBuilder { | ||
@@ -64,0 +60,0 @@ return this.addEntityPermission(entity => { |
@@ -26,12 +26,7 @@ import { Acl } from '@contember/schema' | ||
update: { ...(original.operations.update || {}), ...(overrides.operations.update || {}) }, | ||
...(original.operations.delete === undefined && overrides.operations.delete === undefined | ||
...(overrides.operations.delete === undefined | ||
? {} | ||
: { | ||
delete: overrides.operations.delete ?? original.operations.delete, | ||
delete: overrides.operations.delete, | ||
}), | ||
...(original.operations.customPrimary === undefined && overrides.operations.customPrimary === undefined | ||
? {} | ||
: { | ||
customPrimary: overrides.operations.customPrimary ?? original.operations.customPrimary, | ||
}), | ||
}, | ||
@@ -38,0 +33,0 @@ } |
@@ -25,6 +25,2 @@ import { Acl, Model } from '@contember/schema' | ||
public allowCustomPrimary(): PermissionsBuilder { | ||
return this.onEveryEntity().allowCustomPrimary().builder | ||
} | ||
public add(permissions: Acl.Permissions): PermissionsBuilder { | ||
@@ -31,0 +27,0 @@ const overrider = new PermissionOverrider() |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No tests
QualityPackage does not have any tests. This is a strong signal of a poorly maintained or low quality package.
Found 1 instance in 1 package
852806
2
4754
Updated@contember/schema@^0.9.2