You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
abp/npm/ng-packs/dist/permission-management/bundles/abp-ng.permission-managemen...

1 line
33 KiB

{"version":3,"sources":["../../../node_modules/tslib/tslib.es6.js","ng://@abp/ng.permission-management/lib/actions/permission-management.actions.ts","ng://@abp/ng.permission-management/lib/services/permission-management.service.ts","ng://@abp/ng.permission-management/lib/states/permission-management.state.ts","ng://@abp/ng.permission-management/lib/components/permission-management.component.ts","ng://@abp/ng.permission-management/lib/permission-management.module.ts","ng://@abp/ng.permission-management/lib/models/permission-management.ts","ng://@abp/ng.permission-management/lib/services/permission-management-state.service.ts"],"names":["__assign","Object","assign","t","s","i","n","arguments","length","p","prototype","hasOwnProperty","call","apply","this","__decorate","decorators","target","key","desc","d","c","r","getOwnPropertyDescriptor","Reflect","decorate","defineProperty","__metadata","metadataKey","metadataValue","metadata","__read","o","m","Symbol","iterator","e","ar","next","done","push","value","error","__spread","concat","GetPermissions","payload","type","UpdatePermissions","PermissionManagementService","rest","getPermissions","params","request","method","url","updatePermissions","_a","body","permissions","providerKey","providerName","Injectable","args","providedIn","RestService","PermissionManagementState","permissionManagementService","getPermissionGroups","permissionRes","groups","getEntitiyDisplayName","entityDisplayName","permissionManagementGet","_b","patchState","pipe","tap","permissionResponse","permissionManagementUpdate","_","tslib_1.__decorate","Action","Selector","State","name","defaults","PermissionManagementComponent","store","renderer","visibleChange","EventEmitter","selectThisTab","selectAllTab","modalBusy","trackByFn","item","_visible","selectedGroup","emit","_this","groups$","map","find","group","permission","margin","findMargin","isGranted","per","ngOnInit","getChecked","isGrantedByRole","grantedProviders","findIndex","onClickCheckbox","clickedPermission","setTimeout","parentName","setTabCheckboxState","setGrantCheckboxState","selectedGroupPermissions$","take","subscribe","selectedPermissions","filter","element","document","querySelector","indeterminate","selectedAllPermissions","checkboxElement","onClickSelectThisTab","forEach","index","slice","onClickSelectAll","onChangeGroup","submit","unchangedPermissions","selectSnapshot","changedPermissions","unchanged","dispatch","visible","openModal","Error","pluck","initModal","ngOnChanges","currentValue","Component","selector","template","Store","Renderer2","Input","Output","Select","Observable","parentPermission","reduce","acc","val","PermissionManagement","PermissionManagementModule","NgModule","declarations","imports","CoreModule","ThemeSharedModule","NgxsModule","forFeature","exports","Response","Group","MinimumPermission","Permission","GrantedProvider","UpdateRequest","PermissionManagementStateService","getEntityDisplayName"],"mappings":";;;;;;;;;;;;;;oFA6BO,IAAIA,EAAW,WAQlB,OAPAA,EAAWC,OAAOC,QAAU,SAAkBC,GAC1C,IAAK,IAAIC,EAAGC,EAAI,EAAGC,EAAIC,UAAUC,OAAQH,EAAIC,EAAGD,IAE5C,IAAK,IAAII,KADTL,EAAIG,UAAUF,GACOJ,OAAOS,UAAUC,eAAeC,KAAKR,EAAGK,KAAIN,EAAEM,GAAKL,EAAEK,IAE9E,OAAON,IAEKU,MAAMC,KAAMP,YAezB,SAASQ,EAAWC,EAAYC,EAAQC,EAAKC,GAChD,IAA2HC,EAAvHC,EAAId,UAAUC,OAAQc,EAAID,EAAI,EAAIJ,EAAkB,OAATE,EAAgBA,EAAOlB,OAAOsB,yBAAyBN,EAAQC,GAAOC,EACrH,GAAuB,iBAAZK,SAAoD,mBAArBA,QAAQC,SAAyBH,EAAIE,QAAQC,SAAST,EAAYC,EAAQC,EAAKC,QACpH,IAAK,IAAId,EAAIW,EAAWR,OAAS,EAAGH,GAAK,EAAGA,KAASe,EAAIJ,EAAWX,MAAIiB,GAAKD,EAAI,EAAID,EAAEE,GAAKD,EAAI,EAAID,EAAEH,EAAQC,EAAKI,GAAKF,EAAEH,EAAQC,KAASI,GAChJ,OAAOD,EAAI,GAAKC,GAAKrB,OAAOyB,eAAeT,EAAQC,EAAKI,GAAIA,EAOzD,SAASK,EAAWC,EAAaC,GACpC,GAAuB,iBAAZL,SAAoD,mBAArBA,QAAQM,SAAyB,OAAON,QAAQM,SAASF,EAAaC,GAuD7G,SAASE,EAAOC,EAAG1B,GACtB,IAAI2B,EAAsB,mBAAX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KA,SAAAC,iHAjCF,CAAiBf,IAAAA,EAAoB,KCArC,IAAAgB,EAAA,WAQE,SAAAA,EAAoB5F,GAAA1E,KAAA0E,MAAAA,SAEpB4F,EAAA1K,UAAA0D,oBAAA,WACE,OAAOtD,KAAK0E,MAAMoD,eAAe1E,EAA0BE,sBAE7DgH,EAAA1K,UAAA2K,qBAAA,WACE,OAAOvK,KAAK0E,MAAMoD,eAAe1E,EAA0BE,0CAV9DN,EAAAA,WAAUC,KAAA,CAAC,CACVC,WAAY,oDAJL0F,EAAAA,qIADT","sourcesContent":["/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation. All rights reserved.\r\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\nthis file except in compliance with the License. You may obtain a copy of the\r\nLicense at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\nMERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\nSee the Apache Version 2.0 License for specific language governing permissions\r\nand limitations under the License.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __values(o) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator], i = 0;\r\n if (m) return m.call(o);\r\n return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n};\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result.default = mod;\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n","import { PermissionManagement } from '../models/permission-management';\n\nexport class GetPermissions {\n static readonly type = '[PermissionManagement] Get Permissions';\n constructor(public payload: PermissionManagement.GrantedProvider) {}\n}\n\nexport class UpdatePermissions {\n static readonly type = '[PermissionManagement] Update Permissions';\n constructor(public payload: PermissionManagement.GrantedProvider & PermissionManagement.UpdateRequest) {}\n}\n","import { Injectable } from '@angular/core';\nimport { RestService, Rest } from '@abp/ng.core';\nimport { Observable } from 'rxjs';\nimport { PermissionManagement } from '../models/permission-management';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class PermissionManagementService {\n constructor(private rest: RestService) {}\n\n getPermissions(params: PermissionManagement.GrantedProvider): Observable<PermissionManagement.Response> {\n const request: Rest.Request<PermissionManagement.GrantedProvider> = {\n method: 'GET',\n url: '/api/abp/permissions',\n params,\n };\n\n return this.rest.request<PermissionManagement.GrantedProvider, PermissionManagement.Response>(request);\n }\n\n updatePermissions({\n permissions,\n providerKey,\n providerName,\n }: PermissionManagement.GrantedProvider & PermissionManagement.UpdateRequest): Observable<null> {\n const request: Rest.Request<PermissionManagement.UpdateRequest> = {\n method: 'PUT',\n url: '/api/abp/permissions',\n body: { permissions },\n params: { providerKey, providerName },\n };\n\n return this.rest.request<PermissionManagement.UpdateRequest, null>(request);\n }\n}\n","import { State, Action, StateContext, Selector } from '@ngxs/store';\nimport { GetPermissions, UpdatePermissions } from '../actions/permission-management.actions';\nimport { PermissionManagement } from '../models/permission-management';\nimport { PermissionManagementService } from '../services/permission-management.service';\nimport { tap } from 'rxjs/operators';\n\n@State<PermissionManagement.State>({\n name: 'PermissionManagementState',\n defaults: { permissionRes: {} } as PermissionManagement.State,\n})\nexport class PermissionManagementState {\n @Selector()\n static getPermissionGroups({ permissionRes }: PermissionManagement.State) {\n return permissionRes.groups || [];\n }\n\n @Selector()\n static getEntitiyDisplayName({ permissionRes }: PermissionManagement.State): string {\n return permissionRes.entityDisplayName;\n }\n\n constructor(private permissionManagementService: PermissionManagementService) {}\n\n @Action(GetPermissions)\n permissionManagementGet({ patchState }: StateContext<PermissionManagement.State>, { payload }: GetPermissions) {\n return this.permissionManagementService.getPermissions(payload).pipe(\n tap(permissionResponse =>\n patchState({\n permissionRes: permissionResponse,\n }),\n ),\n );\n }\n\n @Action(UpdatePermissions)\n permissionManagementUpdate(_, { payload }: UpdatePermissions) {\n return this.permissionManagementService.updatePermissions(payload);\n }\n}\n","import {\n Component,\n EventEmitter,\n Input,\n OnChanges,\n OnInit,\n Output,\n Renderer2,\n SimpleChanges,\n TrackByFunction\n} from '@angular/core';\nimport { Select, Store } from '@ngxs/store';\nimport { from, Observable } from 'rxjs';\nimport { map, pluck, take } from 'rxjs/operators';\nimport { GetPermissions, UpdatePermissions } from '../actions/permission-management.actions';\nimport { PermissionManagement } from '../models/permission-management';\nimport { PermissionManagementState } from '../states/permission-management.state';\n\ntype PermissionWithMargin = PermissionManagement.Permission & {\n margin: number;\n};\n\n@Component({\n selector: 'abp-permission-management',\n templateUrl: './permission-management.component.html'\n})\nexport class PermissionManagementComponent implements OnInit, OnChanges {\n @Input()\n providerName: string;\n\n @Input()\n providerKey: string;\n\n protected _visible;\n\n @Input()\n get visible(): boolean {\n return this._visible;\n }\n\n set visible(value: boolean) {\n if (!this.selectedGroup) return;\n\n this._visible = value;\n this.visibleChange.emit(value);\n\n if (!value) {\n this.selectedGroup = null;\n }\n }\n\n @Output() readonly visibleChange = new EventEmitter<boolean>();\n\n @Select(PermissionManagementState.getPermissionGroups)\n groups$: Observable<PermissionManagement.Group[]>;\n\n @Select(PermissionManagementState.getEntitiyDisplayName)\n entityName$: Observable<string>;\n\n selectedGroup: PermissionManagement.Group;\n\n permissions: PermissionManagement.Permission[] = [];\n\n selectThisTab = false;\n\n selectAllTab = false;\n\n modalBusy = false;\n\n trackByFn: TrackByFunction<PermissionManagement.Group> = (_, item) => item.name;\n\n get selectedGroupPermissions$(): Observable<PermissionWithMargin[]> {\n return this.groups$.pipe(\n map(groups =>\n this.selectedGroup ? groups.find(group => group.name === this.selectedGroup.name).permissions : []\n ),\n map<PermissionManagement.Permission[], PermissionWithMargin[]>(permissions =>\n permissions.map(\n permission =>\n (({\n ...permission,\n margin: findMargin(permissions, permission),\n isGranted: this.permissions.find(per => per.name === permission.name).isGranted\n } as any) as PermissionWithMargin)\n )\n )\n );\n }\n\n constructor(private store: Store, private renderer: Renderer2) {}\n\n ngOnInit(): void {}\n\n getChecked(name: string) {\n return (this.permissions.find(per => per.name === name) || { isGranted: false }).isGranted;\n }\n\n isGrantedByRole(grantedProviders: PermissionManagement.GrantedProvider[]): boolean {\n if (grantedProviders.length) {\n return grantedProviders.findIndex(p => p.providerName === 'Role') > -1;\n }\n return false;\n }\n\n onClickCheckbox(clickedPermission: PermissionManagement.Permission, value) {\n if (clickedPermission.isGranted && this.isGrantedByRole(clickedPermission.grantedProviders)) return;\n\n setTimeout(() => {\n this.permissions = this.permissions.map(per => {\n if (clickedPermission.name === per.name) {\n return { ...per, isGranted: !per.isGranted };\n } else if (clickedPermission.name === per.parentName && clickedPermission.isGranted) {\n return { ...per, isGranted: false };\n } else if (clickedPermission.parentName === per.name && !clickedPermission.isGranted) {\n return { ...per, isGranted: true };\n }\n\n return per;\n });\n\n this.setTabCheckboxState();\n this.setGrantCheckboxState();\n }, 0);\n }\n\n setTabCheckboxState() {\n this.selectedGroupPermissions$.pipe(take(1)).subscribe(permissions => {\n const selectedPermissions = permissions.filter(per => per.isGranted);\n const element = document.querySelector('#select-all-in-this-tabs') as any;\n\n if (selectedPermissions.length === permissions.length) {\n element.indeterminate = false;\n this.selectThisTab = true;\n } else if (selectedPermissions.length === 0) {\n element.indeterminate = false;\n this.selectThisTab = false;\n } else {\n element.indeterminate = true;\n }\n });\n }\n\n setGrantCheckboxState() {\n const selectedAllPermissions = this.permissions.filter(per => per.isGranted);\n const checkboxElement = document.querySelector('#select-all-in-all-tabs') as any;\n\n if (selectedAllPermissions.length === this.permissions.length) {\n checkboxElement.indeterminate = false;\n this.selectAllTab = true;\n } else if (selectedAllPermissions.length === 0) {\n checkboxElement.indeterminate = false;\n this.selectAllTab = false;\n } else {\n checkboxElement.indeterminate = true;\n }\n }\n\n onClickSelectThisTab() {\n this.selectedGroupPermissions$.pipe(take(1)).subscribe(permissions => {\n permissions.forEach(permission => {\n if (permission.isGranted && this.isGrantedByRole(permission.grantedProviders)) return;\n\n const index = this.permissions.findIndex(per => per.name === permission.name);\n\n this.permissions = [\n ...this.permissions.slice(0, index),\n { ...this.permissions[index], isGranted: !this.selectThisTab },\n ...this.permissions.slice(index + 1)\n ];\n });\n });\n\n this.setGrantCheckboxState();\n }\n\n onClickSelectAll() {\n this.permissions = this.permissions.map(permission => ({\n ...permission,\n isGranted: !this.selectAllTab\n }));\n\n this.selectThisTab = !this.selectAllTab;\n }\n\n onChangeGroup(group: PermissionManagement.Group) {\n this.selectedGroup = group;\n this.setTabCheckboxState();\n }\n\n submit() {\n this.modalBusy = true;\n const unchangedPermissions = getPermissions(\n this.store.selectSnapshot(PermissionManagementState.getPermissionGroups)\n );\n\n const changedPermissions: PermissionManagement.MinimumPermission[] = this.permissions\n .filter(per =>\n unchangedPermissions.find(unchanged => unchanged.name === per.name).isGranted === per.isGranted ? false : true\n )\n .map(({ name, isGranted }) => ({ name, isGranted }));\n\n if (changedPermissions.length) {\n this.store\n .dispatch(\n new UpdatePermissions({\n providerKey: this.providerKey,\n providerName: this.providerName,\n permissions: changedPermissions\n })\n )\n .subscribe(() => {\n this.modalBusy = false;\n this.visible = false;\n });\n } else {\n this.modalBusy = false;\n this.visible = false;\n }\n }\n\n openModal() {\n if (!this.providerKey || !this.providerName) {\n throw new Error('Provider Key and Provider Name are required.');\n }\n\n this.store\n .dispatch(\n new GetPermissions({\n providerKey: this.providerKey,\n providerName: this.providerName\n })\n )\n .pipe(pluck('PermissionManagementState', 'permissionRes'))\n .subscribe((permissionRes: PermissionManagement.Response) => {\n this.selectedGroup = permissionRes.groups[0];\n this.permissions = getPermissions(permissionRes.groups);\n\n this.visible = true;\n });\n }\n\n initModal() {\n this.setTabCheckboxState();\n this.setGrantCheckboxState();\n }\n\n ngOnChanges({ visible }: SimpleChanges): void {\n if (!visible) return;\n\n if (visible.currentValue) {\n this.openModal();\n } else if (visible.currentValue === false && this.visible) {\n this.visible = false;\n }\n }\n}\n\nfunction findMargin(permissions: PermissionManagement.Permission[], permission: PermissionManagement.Permission) {\n const parentPermission = permissions.find(per => per.name === permission.parentName);\n\n if (parentPermission && parentPermission.parentName) {\n let margin = 20;\n return (margin += findMargin(permissions, parentPermission));\n }\n\n return parentPermission ? 20 : 0;\n}\n\nfunction getPermissions(groups: PermissionManagement.Group[]): PermissionManagement.Permission[] {\n return groups.reduce((acc, val) => [...acc, ...val.permissions], []);\n}\n","import { CoreModule } from '@abp/ng.core';\nimport { ThemeSharedModule } from '@abp/ng.theme.shared';\nimport { NgModule } from '@angular/core';\nimport { NgxsModule } from '@ngxs/store';\nimport { PermissionManagementComponent } from './components/permission-management.component';\nimport { PermissionManagementState } from './states/permission-management.state';\n\n@NgModule({\n declarations: [PermissionManagementComponent],\n imports: [CoreModule, ThemeSharedModule, NgxsModule.forFeature([PermissionManagementState])],\n exports: [PermissionManagementComponent],\n})\nexport class PermissionManagementModule {}\n","export namespace PermissionManagement {\n export interface State {\n permissionRes: Response;\n }\n\n export interface Response {\n entityDisplayName: string;\n groups: Group[];\n }\n\n export interface Group {\n name: string;\n displayName: string;\n permissions: Permission[];\n }\n\n export interface MinimumPermission {\n name: string;\n isGranted: boolean;\n }\n\n export interface Permission extends MinimumPermission {\n displayName: string;\n parentName: string;\n allowedProviders: string[];\n grantedProviders: GrantedProvider[];\n }\n\n export interface GrantedProvider {\n providerName: string;\n providerKey: string;\n }\n\n export interface UpdateRequest {\n permissions: MinimumPermission[];\n }\n}\n","import { Injectable } from '@angular/core';\nimport { Store } from '@ngxs/store';\nimport { PermissionManagementState } from '../states/permission-management.state';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class PermissionManagementStateService {\n constructor(private store: Store) {}\n\n getPermissionGroups() {\n return this.store.selectSnapshot(PermissionManagementState.getPermissionGroups);\n }\n getEntityDisplayName() {\n return this.store.selectSnapshot(PermissionManagementState.getPermissionGroups);\n }\n}\n"]}