Merge branch '19567-copy-to-clipboard' into main. Closes #19567
[arvados.git] / src / services / permission-service / permission-service.ts
1 // Copyright (C) The Arvados Authors. All rights reserved.
2 //
3 // SPDX-License-Identifier: AGPL-3.0
4
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';
10
11 export class PermissionService extends LinkService<PermissionResource> {
12
13     permissionListService = new CommonResourceService(this.serverApi, 'permissions', this.actions);
14     create(data?: Partial<PermissionResource>) {
15         return super.create({ ...data, linkClass: LinkClass.PERMISSION });
16     }
17
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);
21     }
22
23 }