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/fesm2015/abp-ng.permission-managemen...

1 line
23 KiB

{"version":3,"file":"abp-ng.permission-management.js","sources":["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"],"sourcesContent":["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