@dereekb/model 11.0.1 → 11.0.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.
package/index.cjs.js
CHANGED
|
@@ -2203,9 +2203,9 @@ function grantedRoleMapReader(map) {
|
|
|
2203
2203
|
return new GrantedRoleMapReaderInstance(map);
|
|
2204
2204
|
}
|
|
2205
2205
|
class GrantedRoleMapReaderInstance {
|
|
2206
|
-
constructor(
|
|
2206
|
+
constructor(map) {
|
|
2207
2207
|
this._map = void 0;
|
|
2208
|
-
this._map =
|
|
2208
|
+
this._map = map;
|
|
2209
2209
|
}
|
|
2210
2210
|
hasNoAccess() {
|
|
2211
2211
|
return this._map[NO_ACCESS_ROLE_KEY];
|
|
@@ -3423,8 +3423,11 @@ function _call(body, then, direct) {
|
|
|
3423
3423
|
}
|
|
3424
3424
|
class AbstractModelPermissionService {
|
|
3425
3425
|
constructor(modelLoader) {
|
|
3426
|
-
this.
|
|
3427
|
-
this.
|
|
3426
|
+
this._modelLoader = void 0;
|
|
3427
|
+
this._modelLoader = modelLoader;
|
|
3428
|
+
}
|
|
3429
|
+
get modelLoader() {
|
|
3430
|
+
return this._modelLoader;
|
|
3428
3431
|
}
|
|
3429
3432
|
roleMapForKeyContext(key, context) {
|
|
3430
3433
|
const _this = this;
|
package/index.esm.js
CHANGED
|
@@ -2348,8 +2348,9 @@ function grantedRoleMapReader(map) {
|
|
|
2348
2348
|
return new GrantedRoleMapReaderInstance(map);
|
|
2349
2349
|
}
|
|
2350
2350
|
class GrantedRoleMapReaderInstance {
|
|
2351
|
-
constructor(
|
|
2352
|
-
this._map =
|
|
2351
|
+
constructor(map) {
|
|
2352
|
+
this._map = void 0;
|
|
2353
|
+
this._map = map;
|
|
2353
2354
|
}
|
|
2354
2355
|
hasNoAccess() {
|
|
2355
2356
|
return this._map[NO_ACCESS_ROLE_KEY];
|
|
@@ -3556,7 +3557,11 @@ function contextGrantedModelRoles(context, data, roles) {
|
|
|
3556
3557
|
*/
|
|
3557
3558
|
class AbstractModelPermissionService {
|
|
3558
3559
|
constructor(modelLoader) {
|
|
3559
|
-
this.
|
|
3560
|
+
this._modelLoader = void 0;
|
|
3561
|
+
this._modelLoader = modelLoader;
|
|
3562
|
+
}
|
|
3563
|
+
get modelLoader() {
|
|
3564
|
+
return this._modelLoader;
|
|
3560
3565
|
}
|
|
3561
3566
|
async roleMapForKeyContext(key, context) {
|
|
3562
3567
|
const model = await this.modelLoader.loadModelForKey(key, context);
|
package/package.json
CHANGED
|
@@ -33,8 +33,9 @@ export interface KeyOnlyModelPermissionService<C, T, R extends string = string,
|
|
|
33
33
|
* Abstract ModelPermissionService implementation.
|
|
34
34
|
*/
|
|
35
35
|
export declare abstract class AbstractModelPermissionService<C, T, R extends string = string, O = T> implements ModelPermissionService<C, T, R, O> {
|
|
36
|
-
readonly
|
|
36
|
+
private readonly _modelLoader;
|
|
37
37
|
constructor(modelLoader: ModelLoader<C, T>);
|
|
38
|
+
get modelLoader(): ModelLoader<C, T>;
|
|
38
39
|
roleMapForKeyContext(key: string, context: C): Promise<ContextGrantedModelRoles<O, C, R>>;
|
|
39
40
|
roleMapForModelContext(model: T, context: C): Promise<ContextGrantedModelRoles<O, C, R>>;
|
|
40
41
|
protected getRoleMapForOutput(output: O, context: C, model: T): Promise<ContextGrantedModelRoles<O, C, R>>;
|
|
@@ -110,7 +110,7 @@ export interface GrantedRoleMapReader<R extends GrantedRole = GrantedRole> {
|
|
|
110
110
|
export declare function grantedRoleMapReader<R extends GrantedRole = string>(map: GrantedRoleMap<R>): GrantedRoleMapReader<R>;
|
|
111
111
|
export declare class GrantedRoleMapReaderInstance<R extends GrantedRole = string> implements GrantedRoleMapReader<R> {
|
|
112
112
|
private readonly _map;
|
|
113
|
-
constructor(
|
|
113
|
+
constructor(map: GrantedRoleMap<R>);
|
|
114
114
|
hasNoAccess(): boolean;
|
|
115
115
|
truthMap<M extends GrantedRoleTruthMapObject<any, R>>(input: M): GrantedRoleTruthMap<M>;
|
|
116
116
|
hasRole(role: R): boolean;
|