1 | |
2 | * remove granular acls |
3 | * |
4 | */ |
5 | export async function main( |
6 | workspace: string, |
7 | path: string, |
8 | kind: |
9 | | "script" |
10 | | "group_" |
11 | | "resource" |
12 | | "schedule" |
13 | | "variable" |
14 | | "flow" |
15 | | "folder" |
16 | | "app" |
17 | | "raw_app", |
18 | body: { owner: string; [k: string]: unknown } |
19 | ) { |
20 | const url = new URL( |
21 | `${BASE_URL}/api/w/${workspace}/acls/remove/${kind}/${path}` |
22 | ); |
23 |
|
24 | const response = await fetch(url, { |
25 | method: "POST", |
26 | headers: { |
27 | "Content-Type": "application/json", |
28 | Authorization: "Bearer " + WM_TOKEN, |
29 | }, |
30 | body: JSON.stringify(body), |
31 | }); |
32 | if (!response.ok) { |
33 | const text = await response.text(); |
34 | throw new Error(`${response.status} ${text}`); |
35 | } |
36 | return await response.text(); |
37 | } |
38 |
|