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 { ListArguments, ListResults, CommonResourceService } from '~/services/common-service/common-resource-service';
8 import { LinkClass } from '../../models/link';
10 export class PermissionService extends LinkService<PermissionResource> {
12 permissionListService = new CommonResourceService(this.serverApi, 'permissions', this.actions);
13 create(data?: Partial<PermissionResource>) {
14 return super.create({ ...data, linkClass: LinkClass.PERMISSION });
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);