@abp/ng.permission-management 4.4.2 → 5.0.0-beta.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/abp-ng.permission-management.d.ts +1 -5
- package/bundles/abp-ng.permission-management-proxy.umd.js +67 -0
- package/bundles/abp-ng.permission-management-proxy.umd.js.map +1 -0
- package/bundles/abp-ng.permission-management.umd.js +80 -230
- package/bundles/abp-ng.permission-management.umd.js.map +1 -1
- package/esm2015/abp-ng.permission-management.js +1 -5
- package/esm2015/abp-ng.permission-management.js.map +1 -0
- package/esm2015/lib/components/index.js +1 -1
- package/esm2015/lib/components/index.js.map +1 -0
- package/esm2015/lib/components/permission-management.component.js +69 -77
- package/esm2015/lib/components/permission-management.component.js.map +1 -0
- package/esm2015/lib/enums/components.js +1 -1
- package/esm2015/lib/enums/components.js.map +1 -0
- package/esm2015/lib/models/index.js +1 -1
- package/esm2015/lib/models/index.js.map +1 -0
- package/esm2015/lib/models/permission-management.js +1 -1
- package/esm2015/lib/models/permission-management.js.map +1 -0
- package/esm2015/lib/permission-management.module.js +13 -10
- package/esm2015/lib/permission-management.module.js.map +1 -0
- package/esm2015/proxy/abp-ng.permission-management-proxy.js +5 -0
- package/esm2015/proxy/abp-ng.permission-management-proxy.js.map +1 -0
- package/esm2015/proxy/lib/index.js +2 -0
- package/esm2015/proxy/lib/index.js.map +1 -0
- package/esm2015/proxy/lib/proxy/index.js +3 -0
- package/esm2015/proxy/lib/proxy/index.js.map +1 -0
- package/esm2015/proxy/lib/proxy/models.js +2 -0
- package/esm2015/proxy/lib/proxy/models.js.map +1 -0
- package/esm2015/proxy/lib/proxy/permissions.service.js +30 -0
- package/esm2015/proxy/lib/proxy/permissions.service.js.map +1 -0
- package/esm2015/proxy/public-api.js +2 -0
- package/esm2015/proxy/public-api.js.map +1 -0
- package/esm2015/public-api.js +2 -9
- package/esm2015/public-api.js.map +1 -0
- package/fesm2015/abp-ng.permission-management-proxy.js +36 -0
- package/fesm2015/abp-ng.permission-management-proxy.js.map +1 -0
- package/fesm2015/abp-ng.permission-management.js +81 -204
- package/fesm2015/abp-ng.permission-management.js.map +1 -1
- package/lib/components/permission-management.component.d.ts +9 -9
- package/lib/models/permission-management.d.ts +1 -1
- package/lib/permission-management.module.d.ts +7 -0
- package/package.json +6 -4
- package/proxy/abp-ng.permission-management-proxy.d.ts +5 -0
- package/proxy/lib/index.d.ts +1 -0
- package/{lib → proxy/lib}/proxy/index.d.ts +0 -0
- package/{lib → proxy/lib}/proxy/models.d.ts +9 -9
- package/{lib → proxy/lib}/proxy/permissions.service.d.ts +3 -0
- package/proxy/package.json +10 -0
- package/proxy/public-api.d.ts +1 -0
- package/public-api.d.ts +1 -5
- package/abp-ng.permission-management.metadata.json +0 -1
- package/bundles/abp-ng.permission-management.umd.min.js +0 -2
- package/bundles/abp-ng.permission-management.umd.min.js.map +0 -1
- package/esm2015/lib/actions/index.js +0 -2
- package/esm2015/lib/actions/permission-management.actions.js +0 -13
- package/esm2015/lib/proxy/index.js +0 -3
- package/esm2015/lib/proxy/models.js +0 -2
- package/esm2015/lib/proxy/permissions.service.js +0 -31
- package/esm2015/lib/services/index.js +0 -2
- package/esm2015/lib/services/permission-management-state.service.js +0 -33
- package/esm2015/lib/states/index.js +0 -2
- package/esm2015/lib/states/permission-management.state.js +0 -53
- package/lib/actions/index.d.ts +0 -1
- package/lib/actions/permission-management.actions.d.ts +0 -11
- package/lib/services/index.d.ts +0 -1
- package/lib/services/permission-management-state.service.d.ts +0 -10
- package/lib/states/index.d.ts +0 -1
- package/lib/states/permission-management.state.d.ts +0 -12
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Generated bundle index. Do not edit.
|
|
3
3
|
*/
|
|
4
|
+
/// <amd-module name="@abp/ng.permission-management" />
|
|
4
5
|
export * from './public-api';
|
|
5
|
-
export { GetPermissions as ɵd, UpdatePermissions as ɵe } from './lib/actions/permission-management.actions';
|
|
6
|
-
export { PermissionManagementComponent as ɵa } from './lib/components/permission-management.component';
|
|
7
|
-
export { ProviderInfoDto as ɵf } from './lib/proxy/models';
|
|
8
|
-
export { PermissionsService as ɵc } from './lib/proxy/permissions.service';
|
|
9
|
-
export { PermissionManagementState as ɵb } from './lib/states/permission-management.state';
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
(function (global, factory) {
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@abp/ng.core')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define('@abp/ng.permission-management/proxy', ['exports', '@angular/core', '@abp/ng.core'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.abp = global.abp || {}, global.abp.ng = global.abp.ng || {}, global.abp.ng['permission-management'] = global.abp.ng['permission-management'] || {}, global.abp.ng['permission-management'].proxy = {}), global.ng.core, global.i1));
|
|
5
|
+
}(this, (function (exports, i0, i1) { 'use strict';
|
|
6
|
+
|
|
7
|
+
function _interopNamespace(e) {
|
|
8
|
+
if (e && e.__esModule) return e;
|
|
9
|
+
var n = Object.create(null);
|
|
10
|
+
if (e) {
|
|
11
|
+
Object.keys(e).forEach(function (k) {
|
|
12
|
+
if (k !== 'default') {
|
|
13
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
14
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
15
|
+
enumerable: true,
|
|
16
|
+
get: function () {
|
|
17
|
+
return e[k];
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
n['default'] = e;
|
|
24
|
+
return Object.freeze(n);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
var i0__namespace = /*#__PURE__*/_interopNamespace(i0);
|
|
28
|
+
var i1__namespace = /*#__PURE__*/_interopNamespace(i1);
|
|
29
|
+
|
|
30
|
+
var PermissionsService = /** @class */ (function () {
|
|
31
|
+
function PermissionsService(restService) {
|
|
32
|
+
var _this = this;
|
|
33
|
+
this.restService = restService;
|
|
34
|
+
this.apiName = 'AbpPermissionManagement';
|
|
35
|
+
this.get = function (providerName, providerKey) { return _this.restService.request({
|
|
36
|
+
method: 'GET',
|
|
37
|
+
url: '/api/permission-management/permissions',
|
|
38
|
+
params: { providerName: providerName, providerKey: providerKey },
|
|
39
|
+
}, { apiName: _this.apiName }); };
|
|
40
|
+
this.update = function (providerName, providerKey, input) { return _this.restService.request({
|
|
41
|
+
method: 'PUT',
|
|
42
|
+
url: '/api/permission-management/permissions',
|
|
43
|
+
params: { providerName: providerName, providerKey: providerKey },
|
|
44
|
+
body: input,
|
|
45
|
+
}, { apiName: _this.apiName }); };
|
|
46
|
+
}
|
|
47
|
+
return PermissionsService;
|
|
48
|
+
}());
|
|
49
|
+
PermissionsService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.6", ngImport: i0__namespace, type: PermissionsService, deps: [{ token: i1__namespace.RestService }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
50
|
+
PermissionsService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.6", ngImport: i0__namespace, type: PermissionsService, providedIn: 'root' });
|
|
51
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.6", ngImport: i0__namespace, type: PermissionsService, decorators: [{
|
|
52
|
+
type: i0.Injectable,
|
|
53
|
+
args: [{
|
|
54
|
+
providedIn: 'root',
|
|
55
|
+
}]
|
|
56
|
+
}], ctorParameters: function () { return [{ type: i1__namespace.RestService }]; } });
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Generated bundle index. Do not edit.
|
|
60
|
+
*/
|
|
61
|
+
|
|
62
|
+
exports.PermissionsService = PermissionsService;
|
|
63
|
+
|
|
64
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
65
|
+
|
|
66
|
+
})));
|
|
67
|
+
//# sourceMappingURL=abp-ng.permission-management-proxy.umd.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"abp-ng.permission-management-proxy.umd.js","sources":["../../../../packages/permission-management/proxy/src/lib/proxy/permissions.service.ts","../../../../packages/permission-management/proxy/src/abp-ng.permission-management-proxy.ts"],"sourcesContent":["import type { GetPermissionListResultDto, UpdatePermissionsDto } from './models';\nimport { RestService } from '@abp/ng.core';\nimport { Injectable } from '@angular/core';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class PermissionsService {\n apiName = 'AbpPermissionManagement';\n\n get = (providerName: string, providerKey: string) =>\n this.restService.request<any, GetPermissionListResultDto>({\n method: 'GET',\n url: '/api/permission-management/permissions',\n params: { providerName, providerKey },\n },\n { apiName: this.apiName });\n\n update = (providerName: string, providerKey: string, input: UpdatePermissionsDto) =>\n this.restService.request<any, void>({\n method: 'PUT',\n url: '/api/permission-management/permissions',\n params: { providerName, providerKey },\n body: input,\n },\n { apiName: this.apiName });\n\n constructor(private restService: RestService) {}\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["Injectable"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QA2BE,4BAAoB,WAAwB;YAA5C,iBAAgD;YAA5B,gBAAW,GAAX,WAAW,CAAa;YAnB5C,YAAO,GAAG,yBAAyB,CAAC;YAEpC,QAAG,GAAG,UAAC,YAAoB,EAAE,WAAmB,IAC9C,OAAA,KAAI,CAAC,WAAW,CAAC,OAAO,CAAkC;gBACxD,MAAM,EAAE,KAAK;gBACb,GAAG,EAAE,wCAAwC;gBAC7C,MAAM,EAAE,EAAE,YAAY,cAAA,EAAE,WAAW,aAAA,EAAE;aACtC,EACD,EAAE,OAAO,EAAE,KAAI,CAAC,OAAO,EAAE,CAAC,GAAA,CAAC;YAE7B,WAAM,GAAG,UAAC,YAAoB,EAAE,WAAmB,EAAE,KAA2B,IAC9E,OAAA,KAAI,CAAC,WAAW,CAAC,OAAO,CAAY;gBAClC,MAAM,EAAE,KAAK;gBACb,GAAG,EAAE,wCAAwC;gBAC7C,MAAM,EAAE,EAAE,YAAY,cAAA,EAAE,WAAW,aAAA,EAAE;gBACrC,IAAI,EAAE,KAAK;aACZ,EACD,EAAE,OAAO,EAAE,KAAI,CAAC,OAAO,EAAE,CAAC,GAAA,CAAC;SAEmB;;;yIApBrC,kBAAkB;6IAAlB,kBAAkB,cAFjB,MAAM;qHAEP,kBAAkB;sBAH9BA,aAAU;uBAAC;wBACV,UAAU,EAAE,MAAM;qBACnB;;;ICND;;;;;;;;;;;;"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@
|
|
3
|
-
typeof define === 'function' && define.amd ? define('@abp/ng.permission-management', ['exports', '@
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.abp = global.abp || {}, global.abp.ng = global.abp.ng || {}, global.abp.ng['permission-management'] = {}), global.
|
|
5
|
-
}(this, (function (exports,
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('rxjs'), require('rxjs/operators'), require('@abp/ng.permission-management/proxy'), require('@abp/ng.core'), require('@abp/ng.theme.shared'), require('@angular/common'), require('@angular/forms')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define('@abp/ng.permission-management', ['exports', '@angular/core', 'rxjs', 'rxjs/operators', '@abp/ng.permission-management/proxy', '@abp/ng.core', '@abp/ng.theme.shared', '@angular/common', '@angular/forms'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.abp = global.abp || {}, global.abp.ng = global.abp.ng || {}, global.abp.ng['permission-management'] = {}), global.ng.core, global.rxjs, global.rxjs.operators, global.abp.ng['permission-management'].proxy, global.i2, global.i3, global.ng.common, global.ng.forms));
|
|
5
|
+
}(this, (function (exports, i0, rxjs, operators, i1, i2, i3, i4, i5) { 'use strict';
|
|
6
6
|
|
|
7
7
|
function _interopNamespace(e) {
|
|
8
8
|
if (e && e.__esModule) return e;
|
|
@@ -24,9 +24,12 @@
|
|
|
24
24
|
return Object.freeze(n);
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
var i1__namespace = /*#__PURE__*/_interopNamespace(i1);
|
|
28
27
|
var i0__namespace = /*#__PURE__*/_interopNamespace(i0);
|
|
29
|
-
var i1__namespace
|
|
28
|
+
var i1__namespace = /*#__PURE__*/_interopNamespace(i1);
|
|
29
|
+
var i2__namespace = /*#__PURE__*/_interopNamespace(i2);
|
|
30
|
+
var i3__namespace = /*#__PURE__*/_interopNamespace(i3);
|
|
31
|
+
var i4__namespace = /*#__PURE__*/_interopNamespace(i4);
|
|
32
|
+
var i5__namespace = /*#__PURE__*/_interopNamespace(i5);
|
|
30
33
|
|
|
31
34
|
/*! *****************************************************************************
|
|
32
35
|
Copyright (c) Microsoft Corporation.
|
|
@@ -263,7 +266,7 @@
|
|
|
263
266
|
ar[i] = from[i];
|
|
264
267
|
}
|
|
265
268
|
}
|
|
266
|
-
return to.concat(ar || from);
|
|
269
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
267
270
|
}
|
|
268
271
|
function __await(v) {
|
|
269
272
|
return this instanceof __await ? (this.v = v, this) : new __await(v);
|
|
@@ -346,109 +349,14 @@
|
|
|
346
349
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
347
350
|
}
|
|
348
351
|
|
|
349
|
-
var GetPermissions = /** @class */ (function () {
|
|
350
|
-
function GetPermissions(payload) {
|
|
351
|
-
this.payload = payload;
|
|
352
|
-
}
|
|
353
|
-
return GetPermissions;
|
|
354
|
-
}());
|
|
355
|
-
GetPermissions.type = '[PermissionManagement] Get Permissions';
|
|
356
|
-
var UpdatePermissions = /** @class */ (function () {
|
|
357
|
-
function UpdatePermissions(payload) {
|
|
358
|
-
this.payload = payload;
|
|
359
|
-
}
|
|
360
|
-
return UpdatePermissions;
|
|
361
|
-
}());
|
|
362
|
-
UpdatePermissions.type = '[PermissionManagement] Update Permissions';
|
|
363
|
-
|
|
364
|
-
var PermissionsService = /** @class */ (function () {
|
|
365
|
-
function PermissionsService(restService) {
|
|
366
|
-
var _this = this;
|
|
367
|
-
this.restService = restService;
|
|
368
|
-
this.apiName = 'AbpPermissionManagement';
|
|
369
|
-
this.get = function (providerName, providerKey) { return _this.restService.request({
|
|
370
|
-
method: 'GET',
|
|
371
|
-
url: '/api/permission-management/permissions',
|
|
372
|
-
params: { providerName: providerName, providerKey: providerKey },
|
|
373
|
-
}, { apiName: _this.apiName }); };
|
|
374
|
-
this.update = function (providerName, providerKey, input) { return _this.restService.request({
|
|
375
|
-
method: 'PUT',
|
|
376
|
-
url: '/api/permission-management/permissions',
|
|
377
|
-
params: { providerName: providerName, providerKey: providerKey },
|
|
378
|
-
body: input,
|
|
379
|
-
}, { apiName: _this.apiName }); };
|
|
380
|
-
}
|
|
381
|
-
return PermissionsService;
|
|
382
|
-
}());
|
|
383
|
-
PermissionsService.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function PermissionsService_Factory() { return new PermissionsService(i0__namespace.ɵɵinject(i1__namespace.RestService)); }, token: PermissionsService, providedIn: "root" });
|
|
384
|
-
PermissionsService.decorators = [
|
|
385
|
-
{ type: i0.Injectable, args: [{
|
|
386
|
-
providedIn: 'root',
|
|
387
|
-
},] }
|
|
388
|
-
];
|
|
389
|
-
PermissionsService.ctorParameters = function () { return [
|
|
390
|
-
{ type: i1.RestService }
|
|
391
|
-
]; };
|
|
392
|
-
|
|
393
|
-
exports.ɵb = /** @class */ (function () {
|
|
394
|
-
function PermissionManagementState(service) {
|
|
395
|
-
this.service = service;
|
|
396
|
-
}
|
|
397
|
-
PermissionManagementState.getPermissionGroups = function (_a) {
|
|
398
|
-
var permissionRes = _a.permissionRes;
|
|
399
|
-
return permissionRes.groups || [];
|
|
400
|
-
};
|
|
401
|
-
PermissionManagementState.getEntityDisplayName = function (_a) {
|
|
402
|
-
var permissionRes = _a.permissionRes;
|
|
403
|
-
return permissionRes.entityDisplayName;
|
|
404
|
-
};
|
|
405
|
-
PermissionManagementState.prototype.permissionManagementGet = function (_a, _b) {
|
|
406
|
-
var patchState = _a.patchState;
|
|
407
|
-
var _c = _b.payload, _d = _c === void 0 ? {} : _c, providerKey = _d.providerKey, providerName = _d.providerName;
|
|
408
|
-
return this.service.get(providerName, providerKey).pipe(operators.tap(function (permissionResponse) { return patchState({
|
|
409
|
-
permissionRes: permissionResponse,
|
|
410
|
-
}); }));
|
|
411
|
-
};
|
|
412
|
-
PermissionManagementState.prototype.permissionManagementUpdate = function (_, _a) {
|
|
413
|
-
var payload = _a.payload;
|
|
414
|
-
return this.service.update(payload.providerName, payload.providerKey, {
|
|
415
|
-
permissions: payload.permissions,
|
|
416
|
-
});
|
|
417
|
-
};
|
|
418
|
-
return PermissionManagementState;
|
|
419
|
-
}());
|
|
420
|
-
exports.ɵb.decorators = [
|
|
421
|
-
{ type: i0.Injectable }
|
|
422
|
-
];
|
|
423
|
-
exports.ɵb.ctorParameters = function () { return [
|
|
424
|
-
{ type: PermissionsService }
|
|
425
|
-
]; };
|
|
426
|
-
__decorate([
|
|
427
|
-
i1$1.Action(GetPermissions)
|
|
428
|
-
], exports.ɵb.prototype, "permissionManagementGet", null);
|
|
429
|
-
__decorate([
|
|
430
|
-
i1$1.Action(UpdatePermissions)
|
|
431
|
-
], exports.ɵb.prototype, "permissionManagementUpdate", null);
|
|
432
|
-
__decorate([
|
|
433
|
-
i1$1.Selector()
|
|
434
|
-
], exports.ɵb, "getPermissionGroups", null);
|
|
435
|
-
__decorate([
|
|
436
|
-
i1$1.Selector()
|
|
437
|
-
], exports.ɵb, "getEntityDisplayName", null);
|
|
438
|
-
exports.ɵb = __decorate([
|
|
439
|
-
i1$1.State({
|
|
440
|
-
name: 'PermissionManagementState',
|
|
441
|
-
defaults: { permissionRes: {} },
|
|
442
|
-
})
|
|
443
|
-
], exports.ɵb);
|
|
444
|
-
|
|
445
352
|
var PermissionManagementComponent = /** @class */ (function () {
|
|
446
|
-
function PermissionManagementComponent(
|
|
447
|
-
this.
|
|
353
|
+
function PermissionManagementComponent(service, configState) {
|
|
354
|
+
this.service = service;
|
|
448
355
|
this.configState = configState;
|
|
449
356
|
this.hideBadges = false;
|
|
450
357
|
this._visible = false;
|
|
451
358
|
this.visibleChange = new i0.EventEmitter();
|
|
359
|
+
this.data = { groups: [], entityDisplayName: null };
|
|
452
360
|
this.permissions = [];
|
|
453
361
|
this.selectThisTab = false;
|
|
454
362
|
this.selectAllTab = false;
|
|
@@ -467,6 +375,7 @@
|
|
|
467
375
|
this.openModal().subscribe(function () {
|
|
468
376
|
_this._visible = true;
|
|
469
377
|
_this.visibleChange.emit(true);
|
|
378
|
+
_this.initModal();
|
|
470
379
|
});
|
|
471
380
|
}
|
|
472
381
|
else {
|
|
@@ -478,16 +387,17 @@
|
|
|
478
387
|
enumerable: false,
|
|
479
388
|
configurable: true
|
|
480
389
|
});
|
|
481
|
-
Object.defineProperty(PermissionManagementComponent.prototype, "selectedGroupPermissions
|
|
390
|
+
Object.defineProperty(PermissionManagementComponent.prototype, "selectedGroupPermissions", {
|
|
482
391
|
get: function () {
|
|
483
392
|
var _this = this;
|
|
393
|
+
if (!this.selectedGroup)
|
|
394
|
+
return [];
|
|
484
395
|
var margin = "margin-" + (document.body.dir === 'rtl' ? 'right' : 'left') + ".px";
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
: []; }), operators.map(function (permissions) { return permissions.map(function (permission) {
|
|
396
|
+
var permissions = this.data.groups.find(function (group) { return group.name === _this.selectedGroup.name; }).permissions;
|
|
397
|
+
return permissions.map(function (permission) {
|
|
488
398
|
var _a;
|
|
489
399
|
return (Object.assign(Object.assign({}, permission), { style: (_a = {}, _a[margin] = findMargin(permissions, permission), _a), isGranted: _this.permissions.find(function (per) { return per.name === permission.name; }).isGranted }));
|
|
490
|
-
});
|
|
400
|
+
});
|
|
491
401
|
},
|
|
492
402
|
enumerable: false,
|
|
493
403
|
configurable: true
|
|
@@ -525,22 +435,19 @@
|
|
|
525
435
|
}, 0);
|
|
526
436
|
};
|
|
527
437
|
PermissionManagementComponent.prototype.setTabCheckboxState = function () {
|
|
528
|
-
var
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
element.indeterminate = true;
|
|
542
|
-
}
|
|
543
|
-
});
|
|
438
|
+
var selectedPermissions = this.selectedGroupPermissions.filter(function (per) { return per.isGranted; });
|
|
439
|
+
var element = document.querySelector('#select-all-in-this-tabs');
|
|
440
|
+
if (selectedPermissions.length === this.selectedGroupPermissions.length) {
|
|
441
|
+
element.indeterminate = false;
|
|
442
|
+
this.selectThisTab = true;
|
|
443
|
+
}
|
|
444
|
+
else if (selectedPermissions.length === 0) {
|
|
445
|
+
element.indeterminate = false;
|
|
446
|
+
this.selectThisTab = false;
|
|
447
|
+
}
|
|
448
|
+
else {
|
|
449
|
+
element.indeterminate = true;
|
|
450
|
+
}
|
|
544
451
|
};
|
|
545
452
|
PermissionManagementComponent.prototype.setGrantCheckboxState = function () {
|
|
546
453
|
var selectedAllPermissions = this.permissions.filter(function (per) { return per.isGranted; });
|
|
@@ -559,15 +466,13 @@
|
|
|
559
466
|
};
|
|
560
467
|
PermissionManagementComponent.prototype.onClickSelectThisTab = function () {
|
|
561
468
|
var _this = this;
|
|
562
|
-
this.selectedGroupPermissions
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
], _this.permissions.slice(index + 1));
|
|
570
|
-
});
|
|
469
|
+
this.selectedGroupPermissions.forEach(function (permission) {
|
|
470
|
+
if (permission.isGranted && _this.isGrantedByOtherProviderName(permission.grantedProviders))
|
|
471
|
+
return;
|
|
472
|
+
var index = _this.permissions.findIndex(function (per) { return per.name === permission.name; });
|
|
473
|
+
_this.permissions = __spreadArray(__spreadArray(__spreadArray([], __read(_this.permissions.slice(0, index))), [
|
|
474
|
+
Object.assign(Object.assign({}, _this.permissions[index]), { isGranted: !_this.selectThisTab })
|
|
475
|
+
]), __read(_this.permissions.slice(index + 1)));
|
|
571
476
|
});
|
|
572
477
|
this.setGrantCheckboxState();
|
|
573
478
|
};
|
|
@@ -582,7 +487,7 @@
|
|
|
582
487
|
};
|
|
583
488
|
PermissionManagementComponent.prototype.submit = function () {
|
|
584
489
|
var _this = this;
|
|
585
|
-
var unchangedPermissions = getPermissions(this.
|
|
490
|
+
var unchangedPermissions = getPermissions(this.data.groups);
|
|
586
491
|
var changedPermissions = this.permissions
|
|
587
492
|
.filter(function (per) { return unchangedPermissions.find(function (unchanged) { return unchanged.name === per.name; }).isGranted ===
|
|
588
493
|
per.isGranted
|
|
@@ -597,12 +502,8 @@
|
|
|
597
502
|
return;
|
|
598
503
|
}
|
|
599
504
|
this.modalBusy = true;
|
|
600
|
-
this.
|
|
601
|
-
.
|
|
602
|
-
providerKey: this.providerKey,
|
|
603
|
-
providerName: this.providerName,
|
|
604
|
-
permissions: changedPermissions,
|
|
605
|
-
}))
|
|
505
|
+
this.service
|
|
506
|
+
.update(this.providerName, this.providerKey, { permissions: changedPermissions })
|
|
606
507
|
.pipe(operators.switchMap(function () { return _this.shouldFetchAppConfig() ? _this.configState.refreshAppState() : rxjs.of(null); }), operators.finalize(function () { return (_this.modalBusy = false); }))
|
|
607
508
|
.subscribe(function () {
|
|
608
509
|
_this.visible = false;
|
|
@@ -613,12 +514,8 @@
|
|
|
613
514
|
if (!this.providerKey || !this.providerName) {
|
|
614
515
|
throw new Error('Provider Key and Provider Name are required.');
|
|
615
516
|
}
|
|
616
|
-
return this.
|
|
617
|
-
.
|
|
618
|
-
providerKey: this.providerKey,
|
|
619
|
-
providerName: this.providerName,
|
|
620
|
-
}))
|
|
621
|
-
.pipe(operators.pluck('PermissionManagementState', 'permissionRes'), operators.tap(function (permissionRes) {
|
|
517
|
+
return this.service.get(this.providerName, this.providerKey).pipe(operators.tap(function (permissionRes) {
|
|
518
|
+
_this.data = permissionRes;
|
|
622
519
|
_this.selectedGroup = permissionRes.groups[0];
|
|
623
520
|
_this.permissions = getPermissions(permissionRes.groups);
|
|
624
521
|
}));
|
|
@@ -641,31 +538,29 @@
|
|
|
641
538
|
};
|
|
642
539
|
return PermissionManagementComponent;
|
|
643
540
|
}());
|
|
644
|
-
PermissionManagementComponent
|
|
645
|
-
{ type:
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
i1$1.Select(exports.ɵb.getEntityDisplayName)
|
|
668
|
-
], PermissionManagementComponent.prototype, "entityName$", void 0);
|
|
541
|
+
PermissionManagementComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.6", ngImport: i0__namespace, type: PermissionManagementComponent, deps: [{ token: i1__namespace.PermissionsService }, { token: i2__namespace.ConfigStateService }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
542
|
+
PermissionManagementComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.6", type: PermissionManagementComponent, selector: "abp-permission-management", inputs: { providerName: "providerName", providerKey: "providerKey", hideBadges: "hideBadges", visible: "visible" }, outputs: { visibleChange: "visibleChange" }, exportAs: ["abpPermissionManagement"], ngImport: i0__namespace, template: "<abp-modal [(visible)]=\"visible\" [busy]=\"modalBusy\">\n <ng-container *ngIf=\"data.entityDisplayName\">\n <ng-template #abpHeader>\n <h4>\n {{ 'AbpPermissionManagement::Permissions' | abpLocalization }} -\n {{ data.entityDisplayName }}\n </h4>\n </ng-template>\n <ng-template #abpBody>\n <div class=\"custom-checkbox custom-control mb-2\">\n <input\n type=\"checkbox\"\n id=\"select-all-in-all-tabs\"\n name=\"select-all-in-all-tabs\"\n class=\"custom-control-input\"\n [(ngModel)]=\"selectAllTab\"\n (click)=\"onClickSelectAll()\"\n />\n <label class=\"custom-control-label\" for=\"select-all-in-all-tabs\">{{\n 'AbpPermissionManagement::SelectAllInAllTabs' | abpLocalization\n }}</label>\n </div>\n\n <hr class=\"mt-2 mb-2\" />\n <div class=\"row\">\n <div class=\"overflow-scroll col-md-4\">\n <ul class=\"nav nav-pills flex-column\">\n <li *ngFor=\"let group of data.groups; trackBy: trackByFn\" class=\"nav-item\">\n <a\n *ngIf=\"{ assignedCount: getAssignedCount(group.name) } as count\"\n class=\"nav-link pointer\"\n [class.active]=\"selectedGroup?.name === group?.name\"\n (click)=\"onChangeGroup(group)\"\n >\n <div [class.font-weight-bold]=\"count.assignedCount\">\n {{ group?.displayName }}\n <span>({{ count.assignedCount }})</span>\n </div>\n </a>\n </li>\n </ul>\n </div>\n <div class=\"col-md-8 overflow-scroll\">\n <h4>{{ selectedGroup?.displayName }}</h4>\n <hr class=\"mt-2 mb-3\" />\n <div class=\"pl-1 pt-1\">\n <div class=\"custom-checkbox custom-control mb-2\">\n <input\n type=\"checkbox\"\n id=\"select-all-in-this-tabs\"\n name=\"select-all-in-this-tabs\"\n class=\"custom-control-input\"\n [(ngModel)]=\"selectThisTab\"\n (click)=\"onClickSelectThisTab()\"\n />\n <label class=\"custom-control-label\" for=\"select-all-in-this-tabs\">{{\n 'AbpPermissionManagement::SelectAllInThisTab' | abpLocalization\n }}</label>\n </div>\n <hr class=\"mb-3\" />\n <div\n *ngFor=\"let permission of selectedGroupPermissions; let i = index; trackBy: trackByFn\"\n [ngStyle]=\"permission.style\"\n class=\"custom-checkbox custom-control mb-2\"\n >\n <input\n #permissionCheckbox\n type=\"checkbox\"\n [checked]=\"getChecked(permission.name)\"\n [value]=\"getChecked(permission.name)\"\n [attr.id]=\"permission.name\"\n class=\"custom-control-input\"\n [disabled]=\"isGrantedByOtherProviderName(permission.grantedProviders)\"\n />\n <label\n class=\"custom-control-label\"\n [attr.for]=\"permission.name\"\n (click)=\"onClickCheckbox(permission, permissionCheckbox.value)\"\n >{{ permission.displayName }}\n <ng-container *ngIf=\"!hideBadges\">\n <span\n *ngFor=\"let provider of permission.grantedProviders\"\n class=\"badge badge-light\"\n >{{ provider.providerName }}: {{ provider.providerKey }}</span\n >\n </ng-container>\n </label>\n </div>\n </div>\n </div>\n </div>\n </ng-template>\n <ng-template #abpFooter>\n <button type=\"button\" class=\"btn btn-secondary\" abpClose>\n {{ 'AbpIdentity::Cancel' | abpLocalization }}\n </button>\n <abp-button iconClass=\"fa fa-check\" (click)=\"submit()\">{{\n 'AbpIdentity::Save' | abpLocalization\n }}</abp-button>\n </ng-template>\n </ng-container>\n</abp-modal>\n", styles: ["\n .overflow-scroll {\n max-height: 70vh;\n overflow-y: scroll;\n }\n "], components: [{ type: i3__namespace.ModalComponent, selector: "abp-modal", inputs: ["visible", "busy", "options", "suppressUnsavedChangesWarning"], outputs: ["visibleChange", "init", "appear", "disappear"] }, { type: i3__namespace.ButtonComponent, selector: "abp-button", inputs: ["buttonId", "buttonClass", "buttonType", "iconClass", "loading", "disabled", "attributes"], outputs: ["click", "focus", "blur", "abpClick", "abpFocus", "abpBlur"] }], directives: [{ type: i4__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i5__namespace.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { type: i5__namespace.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i5__namespace.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i4__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i4__namespace.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { type: i3__namespace.ModalCloseDirective, selector: "[abpClose]" }], pipes: { "abpLocalization": i2__namespace.LocalizationPipe } });
|
|
543
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.6", ngImport: i0__namespace, type: PermissionManagementComponent, decorators: [{
|
|
544
|
+
type: i0.Component,
|
|
545
|
+
args: [{
|
|
546
|
+
selector: 'abp-permission-management',
|
|
547
|
+
templateUrl: './permission-management.component.html',
|
|
548
|
+
exportAs: 'abpPermissionManagement',
|
|
549
|
+
styles: [
|
|
550
|
+
"\n .overflow-scroll {\n max-height: 70vh;\n overflow-y: scroll;\n }\n ",
|
|
551
|
+
],
|
|
552
|
+
}]
|
|
553
|
+
}], ctorParameters: function () { return [{ type: i1__namespace.PermissionsService }, { type: i2__namespace.ConfigStateService }]; }, propDecorators: { providerName: [{
|
|
554
|
+
type: i0.Input
|
|
555
|
+
}], providerKey: [{
|
|
556
|
+
type: i0.Input
|
|
557
|
+
}], hideBadges: [{
|
|
558
|
+
type: i0.Input
|
|
559
|
+
}], visible: [{
|
|
560
|
+
type: i0.Input
|
|
561
|
+
}], visibleChange: [{
|
|
562
|
+
type: i0.Output
|
|
563
|
+
}] } });
|
|
669
564
|
function findMargin(permissions, permission) {
|
|
670
565
|
var parentPermission = permissions.find(function (per) { return per.name === permission.parentName; });
|
|
671
566
|
if (parentPermission && parentPermission.parentName) {
|
|
@@ -675,7 +570,7 @@
|
|
|
675
570
|
return parentPermission ? 20 : 0;
|
|
676
571
|
}
|
|
677
572
|
function getPermissions(groups) {
|
|
678
|
-
return groups.reduce(function (acc, val) { return
|
|
573
|
+
return groups.reduce(function (acc, val) { return __spreadArray(__spreadArray([], __read(acc)), __read(val.permissions)); }, []);
|
|
679
574
|
}
|
|
680
575
|
|
|
681
576
|
var PermissionManagementModule = /** @class */ (function () {
|
|
@@ -683,69 +578,24 @@
|
|
|
683
578
|
}
|
|
684
579
|
return PermissionManagementModule;
|
|
685
580
|
}());
|
|
686
|
-
PermissionManagementModule
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
}
|
|
698
|
-
PermissionManagementStateService.prototype.getPermissionGroups = function () {
|
|
699
|
-
return this.store.selectSnapshot(exports.ɵb.getPermissionGroups);
|
|
700
|
-
};
|
|
701
|
-
PermissionManagementStateService.prototype.getEntityDisplayName = function () {
|
|
702
|
-
return this.store.selectSnapshot(exports.ɵb.getEntityDisplayName);
|
|
703
|
-
};
|
|
704
|
-
PermissionManagementStateService.prototype.dispatchGetPermissions = function () {
|
|
705
|
-
var args = [];
|
|
706
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
707
|
-
args[_i] = arguments[_i];
|
|
708
|
-
}
|
|
709
|
-
return this.store.dispatch(new (GetPermissions.bind.apply(GetPermissions, __spread([void 0], args)))());
|
|
710
|
-
};
|
|
711
|
-
PermissionManagementStateService.prototype.dispatchUpdatePermissions = function () {
|
|
712
|
-
var args = [];
|
|
713
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
714
|
-
args[_i] = arguments[_i];
|
|
715
|
-
}
|
|
716
|
-
return this.store.dispatch(new (UpdatePermissions.bind.apply(UpdatePermissions, __spread([void 0], args)))());
|
|
717
|
-
};
|
|
718
|
-
return PermissionManagementStateService;
|
|
719
|
-
}());
|
|
720
|
-
PermissionManagementStateService.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function PermissionManagementStateService_Factory() { return new PermissionManagementStateService(i0__namespace.ɵɵinject(i1__namespace$1.Store)); }, token: PermissionManagementStateService, providedIn: "root" });
|
|
721
|
-
PermissionManagementStateService.decorators = [
|
|
722
|
-
{ type: i0.Injectable, args: [{
|
|
723
|
-
providedIn: 'root',
|
|
724
|
-
},] }
|
|
725
|
-
];
|
|
726
|
-
PermissionManagementStateService.ctorParameters = function () { return [
|
|
727
|
-
{ type: i1$1.Store }
|
|
728
|
-
]; };
|
|
729
|
-
|
|
730
|
-
/*
|
|
731
|
-
* Public API Surface of permission-management
|
|
732
|
-
*/
|
|
581
|
+
PermissionManagementModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.6", ngImport: i0__namespace, type: PermissionManagementModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
|
|
582
|
+
PermissionManagementModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.6", ngImport: i0__namespace, type: PermissionManagementModule, declarations: [PermissionManagementComponent], imports: [i2.CoreModule, i3.ThemeSharedModule], exports: [PermissionManagementComponent] });
|
|
583
|
+
PermissionManagementModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.6", ngImport: i0__namespace, type: PermissionManagementModule, imports: [[i2.CoreModule, i3.ThemeSharedModule]] });
|
|
584
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.6", ngImport: i0__namespace, type: PermissionManagementModule, decorators: [{
|
|
585
|
+
type: i0.NgModule,
|
|
586
|
+
args: [{
|
|
587
|
+
declarations: [PermissionManagementComponent],
|
|
588
|
+
imports: [i2.CoreModule, i3.ThemeSharedModule],
|
|
589
|
+
exports: [PermissionManagementComponent],
|
|
590
|
+
}]
|
|
591
|
+
}] });
|
|
733
592
|
|
|
734
593
|
/**
|
|
735
594
|
* Generated bundle index. Do not edit.
|
|
736
595
|
*/
|
|
737
596
|
|
|
738
|
-
exports.GetPermissions = GetPermissions;
|
|
739
597
|
exports.PermissionManagementComponent = PermissionManagementComponent;
|
|
740
598
|
exports.PermissionManagementModule = PermissionManagementModule;
|
|
741
|
-
exports.PermissionManagementState = exports.ɵb;
|
|
742
|
-
exports.PermissionManagementStateService = PermissionManagementStateService;
|
|
743
|
-
exports.PermissionsService = PermissionsService;
|
|
744
|
-
exports.UpdatePermissions = UpdatePermissions;
|
|
745
|
-
exports.ɵa = PermissionManagementComponent;
|
|
746
|
-
exports.ɵc = PermissionsService;
|
|
747
|
-
exports.ɵd = GetPermissions;
|
|
748
|
-
exports.ɵe = UpdatePermissions;
|
|
749
599
|
|
|
750
600
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
751
601
|
|