mirror of https://github.com/abpframework/abp.git
10 changed files with 4308 additions and 6 deletions
File diff suppressed because it is too large
@ -0,0 +1,2 @@ |
|||
export * from './models'; |
|||
export * from './permissions.service'; |
|||
@ -0,0 +1,34 @@ |
|||
|
|||
export interface GetPermissionListResultDto { |
|||
entityDisplayName: string; |
|||
groups: PermissionGroupDto[]; |
|||
} |
|||
|
|||
export interface PermissionGrantInfoDto { |
|||
name: string; |
|||
displayName: string; |
|||
parentName: string; |
|||
isGranted: boolean; |
|||
allowedProviders: string[]; |
|||
grantedProviders: ProviderInfoDto[]; |
|||
} |
|||
|
|||
export interface PermissionGroupDto { |
|||
name: string; |
|||
displayName: string; |
|||
permissions: PermissionGrantInfoDto[]; |
|||
} |
|||
|
|||
export interface ProviderInfoDto { |
|||
providerName: string; |
|||
providerKey: string; |
|||
} |
|||
|
|||
export interface UpdatePermissionDto { |
|||
name: string; |
|||
isGranted: boolean; |
|||
} |
|||
|
|||
export interface UpdatePermissionsDto { |
|||
permissions: UpdatePermissionDto[]; |
|||
} |
|||
@ -0,0 +1,29 @@ |
|||
import type { GetPermissionListResultDto, UpdatePermissionsDto } from './models'; |
|||
import { RestService } from '@abp/ng.core'; |
|||
import { Injectable } from '@angular/core'; |
|||
|
|||
@Injectable({ |
|||
providedIn: 'root', |
|||
}) |
|||
export class PermissionsService { |
|||
apiName = 'AbpPermissionManagement'; |
|||
|
|||
get = (providerName: string, providerKey: string) => |
|||
this.restService.request<any, GetPermissionListResultDto>({ |
|||
method: 'GET', |
|||
url: '/api/permission-management/permissions', |
|||
params: { providerName, providerKey }, |
|||
}, |
|||
{ apiName: this.apiName }); |
|||
|
|||
update = (providerName: string, providerKey: string, input: UpdatePermissionsDto) => |
|||
this.restService.request<any, void>({ |
|||
method: 'PUT', |
|||
url: '/api/permission-management/permissions', |
|||
params: { providerName, providerKey }, |
|||
body: input, |
|||
}, |
|||
{ apiName: this.apiName }); |
|||
|
|||
constructor(private restService: RestService) {} |
|||
} |
|||
Loading…
Reference in new issue