Merge branch 'master'
[arvados-workbench2.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 { ListArguments, ListResults, CommonResourceService } from '~/services/common-service/common-resource-service';
8 import { LinkClass } from '../../models/link';
9
10 export class PermissionService extends LinkService<PermissionResource> {
11
12     permissionListService = new CommonResourceService(this.serverApi, 'permissions', this.actions);
13     create(data?: Partial<PermissionResource>) {
14         return super.create({ ...data, linkClass: LinkClass.PERMISSION });
15     }
16
17     listResourcePermissions(uuid: string, args: ListArguments = {}): Promise<ListResults<PermissionResource>> {
18         const service = new CommonResourceService<PermissionResource>(this.serverApi, `permissions/${uuid}`, this.actions);
19         return service.list(args);
20     }
21
22 }