@budibase/frontend-core 2.9.33-alpha.11 → 2.9.33-alpha.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +4 -4
- package/src/api/permissions.js +23 -0
package/package.json
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@budibase/frontend-core",
|
|
3
|
-
"version": "2.9.33-alpha.
|
|
3
|
+
"version": "2.9.33-alpha.13",
|
|
4
4
|
"description": "Budibase frontend core libraries used in builder and client",
|
|
5
5
|
"author": "Budibase",
|
|
6
6
|
"license": "MPL-2.0",
|
|
7
7
|
"svelte": "src/index.js",
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"@budibase/bbui": "2.9.33-alpha.
|
|
10
|
-
"@budibase/shared-core": "2.9.33-alpha.
|
|
9
|
+
"@budibase/bbui": "2.9.33-alpha.13",
|
|
10
|
+
"@budibase/shared-core": "2.9.33-alpha.13",
|
|
11
11
|
"dayjs": "^1.11.7",
|
|
12
12
|
"lodash": "^4.17.21",
|
|
13
13
|
"socket.io-client": "^4.6.1",
|
|
14
14
|
"svelte": "^3.46.2"
|
|
15
15
|
},
|
|
16
|
-
"gitHead": "
|
|
16
|
+
"gitHead": "cbac4a996e0723c1061d053a9189a9b0cb326f67"
|
|
17
17
|
}
|
package/src/api/permissions.js
CHANGED
|
@@ -21,4 +21,27 @@ export const buildPermissionsEndpoints = API => ({
|
|
|
21
21
|
url: `/api/permission/${roleId}/${resourceId}/${level}`,
|
|
22
22
|
})
|
|
23
23
|
},
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Remove the the permissions for a certain resource
|
|
27
|
+
* @param resourceId the ID of the resource to update
|
|
28
|
+
* @param roleId the ID of the role to update the permissions of
|
|
29
|
+
* @param level the level to remove the role for this resource
|
|
30
|
+
* @return {Promise<*>}
|
|
31
|
+
*/
|
|
32
|
+
removePermissionFromResource: async ({ resourceId, roleId, level }) => {
|
|
33
|
+
return await API.delete({
|
|
34
|
+
url: `/api/permission/${roleId}/${resourceId}/${level}`,
|
|
35
|
+
})
|
|
36
|
+
},
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Gets info about the resources that depend on this resource permissions
|
|
40
|
+
* @param resourceId the resource ID to check
|
|
41
|
+
*/
|
|
42
|
+
getDependants: async resourceId => {
|
|
43
|
+
return await API.get({
|
|
44
|
+
url: `/api/permission/${resourceId}/dependants`,
|
|
45
|
+
})
|
|
46
|
+
},
|
|
24
47
|
})
|