Gate export/import command menu items by permission flag (#19991)
## Summary - Hides the `exportRecords`, `exportView`, and `importRecords` command menu actions from users whose role does not hold the matching `EXPORT_CSV` / `IMPORT_CSV` permission flag. - Exposes the current user's role permission flags to `conditionalAvailabilityExpression` by adding `permissionFlags: Record<string, boolean>` to `CommandMenuContextApi`, mirroring how `featureFlags` is already accessible. - Adds a `2.1.0` workspace upgrade command that rewrites the three existing rows on every active/suspended workspace. ## Before <img width="1294" height="287" alt="Screenshot 2026-04-22 at 19 37 40" src="https://github.com/user-attachments/assets/11ca8635-14d7-40a0-9ca0-76329c54e3c6" /> ## After <img width="1283" height="285" alt="Screenshot 2026-04-22 at 19 32 25" src="https://github.com/user-attachments/assets/5e49fa8a-4541-42ee-96da-4c1de7d00aae" />
This commit is contained in:
+4
-3
@@ -148,7 +148,7 @@ export const STANDARD_COMMAND_MENU_ITEMS = {
|
||||
position: 10,
|
||||
shortLabel: 'Export',
|
||||
availabilityType: CommandMenuItemAvailabilityType.RECORD_SELECTION,
|
||||
conditionalAvailabilityExpression: null,
|
||||
conditionalAvailabilityExpression: 'permissionFlags.EXPORT_CSV',
|
||||
availabilityObjectMetadataUniversalIdentifier: null,
|
||||
frontComponentUniversalIdentifier: null,
|
||||
engineComponentKey: EngineComponentKey.EXPORT_RECORDS,
|
||||
@@ -192,7 +192,8 @@ export const STANDARD_COMMAND_MENU_ITEMS = {
|
||||
position: 13,
|
||||
shortLabel: 'Import',
|
||||
availabilityType: CommandMenuItemAvailabilityType.GLOBAL_OBJECT_CONTEXT,
|
||||
conditionalAvailabilityExpression: 'not hasAnySoftDeleteFilterOnView',
|
||||
conditionalAvailabilityExpression:
|
||||
'not hasAnySoftDeleteFilterOnView and permissionFlags.IMPORT_CSV',
|
||||
availabilityObjectMetadataUniversalIdentifier: null,
|
||||
frontComponentUniversalIdentifier: null,
|
||||
engineComponentKey: EngineComponentKey.IMPORT_RECORDS,
|
||||
@@ -206,7 +207,7 @@ export const STANDARD_COMMAND_MENU_ITEMS = {
|
||||
position: 14,
|
||||
shortLabel: 'Export',
|
||||
availabilityType: CommandMenuItemAvailabilityType.GLOBAL_OBJECT_CONTEXT,
|
||||
conditionalAvailabilityExpression: null,
|
||||
conditionalAvailabilityExpression: 'permissionFlags.EXPORT_CSV',
|
||||
availabilityObjectMetadataUniversalIdentifier: null,
|
||||
frontComponentUniversalIdentifier: null,
|
||||
engineComponentKey: EngineComponentKey.EXPORT_VIEW,
|
||||
|
||||
Reference in New Issue
Block a user