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...

16 lines
14 KiB

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@abp/ng.core"),require("@abp/ng.theme.shared"),require("@angular/core"),require("@ngxs/store"),require("rxjs"),require("rxjs/operators")):"function"==typeof define&&define.amd?define("@abp/ng.permission-management",["exports","@abp/ng.core","@abp/ng.theme.shared","@angular/core","@ngxs/store","rxjs","rxjs/operators"],t):t(((e=e||self).abp=e.abp||{},e.abp.ng=e.abp.ng||{},e.abp.ng["permission-management"]={}),e.ng_core,e.ng_theme_shared,e.ng.core,e.store,e.rxjs,e.rxjs.operators)}(this,(function(e,t,n,i,r,s,o){"use strict";
/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */var a=function(){return(a=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};function c(e,t,n,i){var r,s=arguments.length,o=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(s<3?r(o):s>3?r(t,n,o):r(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o}function p(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function l(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var i,r,s=n.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(i=s.next()).done;)o.push(i.value)}catch(e){r={error:e}}finally{try{i&&!i.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}return o}function u(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(l(arguments[t]));return e}var m=function(){function e(e){this.payload=e}return e.type="[PermissionManagement] Get Permissions",e}();var d=function(){function e(e){this.payload=e}return e.type="[PermissionManagement] Update Permissions",e}();var b=function(){function e(e){this.rest=e}return e.prototype.getPermissions=function(e){var t={method:"GET",url:"/api/abp/permissions",params:e};return this.rest.request(t)},e.prototype.updatePermissions=function(e){var t={method:"PUT",url:"/api/abp/permissions",body:{permissions:e.permissions},params:{providerKey:e.providerKey,providerName:e.providerName}};return this.rest.request(t)},e.decorators=[{type:i.Injectable,args:[{providedIn:"root"}]}],e.ctorParameters=function(){return[{type:t.RestService}]},e.ngInjectableDef=i.ɵɵdefineInjectable({factory:function(){return new e(i.ɵɵinject(t.RestService))},token:e,providedIn:"root"}),e}();var f=function(){function e(e){this.permissionManagementService=e}return e.getPermissionGroups=function(e){return e.permissionRes.groups||[]},e.getEntitiyDisplayName=function(e){return e.permissionRes.entityDisplayName},e.prototype.permissionManagementGet=function(e,t){var n=e.patchState,i=t.payload;return this.permissionManagementService.getPermissions(i).pipe(o.tap((function(e){return n({permissionRes:e})})))},e.prototype.permissionManagementUpdate=function(e,t){var n=t.payload;return this.permissionManagementService.updatePermissions(n)},e.ctorParameters=function(){return[{type:b}]},c([r.Action(m),p("design:type",Function),p("design:paramtypes",[Object,m]),p("design:returntype",void 0)],e.prototype,"permissionManagementGet",null),c([r.Action(d),p("design:type",Function),p("design:paramtypes",[Object,d]),p("design:returntype",void 0)],e.prototype,"permissionManagementUpdate",null),c([r.Selector(),p("design:type",Function),p("design:paramtypes",[Object]),p("design:returntype",void 0)],e,"getPermissionGroups",null),c([r.Selector(),p("design:type",Function),p("design:paramtypes",[Object]),p("design:returntype",String)],e,"getEntitiyDisplayName",null),e=c([r.State({name:"PermissionManagementState",defaults:{permissionRes:{}}}),p("design:paramtypes",[b])],e)}();var h=function(){function e(e,t){this.store=e,this.renderer=t,this.visibleChange=new i.EventEmitter,this.permissions=[],this.selectThisTab=!1,this.selectAllTab=!1,this.modalBusy=!1,this.trackByFn=function(e,t){return t.name}}return Object.defineProperty(e.prototype,"visible",{get:function(){return this._visible},set:function(e){this.selectedGroup&&(this._visible=e,this.visibleChange.emit(e),e||(this.selectedGroup=null))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"selectedGroupPermissions$",{get:function(){var e=this;return this.groups$.pipe(o.map((function(t){return e.selectedGroup?t.find((function(t){return t.name===e.selectedGroup.name})).permissions:[]})),o.map((function(t){return t.map((function(n){return a({},n,{margin:y(t,n),isGranted:e.permissions.find((function(e){return e.name===n.name})).isGranted})}))})))},
//# sourceMappingURL=abp-ng.permission-management.umd.min.js.map