Merge branch '18028-all-procs-context-menu'. Closes #18028
[arvados.git] / src / views-components / context-menu / action-sets / permission-edit-action-set.ts
1 // Copyright (C) The Arvados Authors. All rights reserved.
2 //
3 // SPDX-License-Identifier: AGPL-3.0
4
5 import { ContextMenuActionSet } from "views-components/context-menu/context-menu-action-set";
6 import { CanReadIcon, CanManageIcon, CanWriteIcon } from "components/icon/icon";
7 import { editPermissionLevel } from 'store/group-details-panel/group-details-panel-actions';
8 import { PermissionLevel } from "models/permission";
9
10 export const permissionEditActionSet: ContextMenuActionSet = [[{
11     name: "Read",
12     icon: CanReadIcon,
13     execute: (dispatch, { uuid }) => {
14         dispatch<any>(editPermissionLevel(uuid, PermissionLevel.CAN_READ));
15     }
16 }, {
17     name: "Write",
18     icon: CanWriteIcon,
19     execute: (dispatch, { uuid }) => {
20         dispatch<any>(editPermissionLevel(uuid, PermissionLevel.CAN_WRITE));
21     }
22 }, {
23     name: "Manage",
24     icon: CanManageIcon,
25     execute: (dispatch, { uuid }) => {
26         dispatch<any>(editPermissionLevel(uuid, PermissionLevel.CAN_MANAGE));
27     }
28 }]];