1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: AGPL-3.0
5 import { LinkService } from "services/link-service/link-service";
6 import { PermissionResource } from "models/permission";
7 import { CommonResourceService } from 'services/common-service/common-resource-service';
8 import { LinkClass } from '../../models/link';
9 import { ListArguments, ListResults } from 'services/common-service/common-service';
11 export class PermissionService extends LinkService<PermissionResource> {
13 permissionListService = new CommonResourceService(this.serverApi, 'permissions', this.actions);
14 create(data?: Partial<PermissionResource>) {
15 return super.create({ ...data, linkClass: LinkClass.PERMISSION });
18 listResourcePermissions(uuid: string, args: ListArguments = {}): Promise<ListResults<PermissionResource>> {
19 const service = new CommonResourceService<PermissionResource>(this.serverApi, `permissions/${uuid}`, this.actions);
20 return service.list(args);