@stoker-platform/web-app 0.5.85 → 0.5.87
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/CHANGELOG.md +15 -0
- package/package.json +4 -4
- package/src/Form.tsx +10 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# @stoker-platform/web-app
|
|
2
2
|
|
|
3
|
+
## 0.5.87
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
- @stoker-platform/utils@0.5.41
|
|
9
|
+
- @stoker-platform/node-client@0.5.49
|
|
10
|
+
- @stoker-platform/web-client@0.5.49
|
|
11
|
+
|
|
12
|
+
## 0.5.86
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- fix: refactor hidden permissions collections
|
|
17
|
+
|
|
3
18
|
## 0.5.85
|
|
4
19
|
|
|
5
20
|
### Patch Changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stoker-platform/web-app",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.87",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
6
6
|
"scripts": {
|
|
@@ -51,9 +51,9 @@
|
|
|
51
51
|
"@radix-ui/react-tooltip": "^1.2.8",
|
|
52
52
|
"@react-google-maps/api": "^2.20.8",
|
|
53
53
|
"@sentry/react": "^10.50.0",
|
|
54
|
-
"@stoker-platform/node-client": "0.5.
|
|
55
|
-
"@stoker-platform/utils": "0.5.
|
|
56
|
-
"@stoker-platform/web-client": "0.5.
|
|
54
|
+
"@stoker-platform/node-client": "0.5.49",
|
|
55
|
+
"@stoker-platform/utils": "0.5.41",
|
|
56
|
+
"@stoker-platform/web-client": "0.5.49",
|
|
57
57
|
"@tanstack/react-table": "^8.21.3",
|
|
58
58
|
"@types/react": "18.3.13",
|
|
59
59
|
"@types/react-dom": "18.3.1",
|
package/src/Form.tsx
CHANGED
|
@@ -2980,6 +2980,14 @@ function RecordForm({
|
|
|
2980
2980
|
})
|
|
2981
2981
|
}
|
|
2982
2982
|
|
|
2983
|
+
const hasOperationAccess = (permissionsCollection: CollectionSchema, operation: string) => {
|
|
2984
|
+
const { access } = permissionsCollection
|
|
2985
|
+
const roleForAssignability = record?.Role || formValues.Role
|
|
2986
|
+
return (access.operations[operation.toLowerCase() as keyof AccessOperations] as string[])?.includes(
|
|
2987
|
+
roleForAssignability,
|
|
2988
|
+
)
|
|
2989
|
+
}
|
|
2990
|
+
|
|
2983
2991
|
const isAssignable = (permissionsCollection: CollectionSchema) => {
|
|
2984
2992
|
const { access } = permissionsCollection
|
|
2985
2993
|
const roleForAssignability = record?.Role || formValues.Role
|
|
@@ -4588,10 +4596,10 @@ function RecordForm({
|
|
|
4588
4596
|
)
|
|
4589
4597
|
|
|
4590
4598
|
if (
|
|
4591
|
-
!isAssignable(permissionsCollection) &&
|
|
4592
4599
|
!hasEntityRestrictions &&
|
|
4593
4600
|
operations.every(
|
|
4594
|
-
(operation) =>
|
|
4601
|
+
(operation) =>
|
|
4602
|
+
!hasOperationAccess(permissionsCollection, operation),
|
|
4595
4603
|
)
|
|
4596
4604
|
)
|
|
4597
4605
|
return null
|