dosubot[bot] commented on issue #30317:
URL: https://github.com/apache/superset/issues/30317#issuecomment-2358390211
<!-- Answer -->
To make the permission label "can csv on Superset" more precise, you can
update it to something like "can download charts in CSV, Excel, and Image
formats".
Here is the relevant code snippet where the permission is checked and the
menu items for downloading are created:
```tsx
{props.supersetCanCSV && (
<Menu.SubMenu
title={t('Download')}
key={MenuKeys.Download}
onTitleMouseEnter={() => setOpenKeys(undefined)}
>
<Menu.Item
key={MenuKeys.ExportCsv}
icon={<Icons.FileOutlined css={dropdownIconsStyles} />}
>
{t('Export to .CSV')}
</Menu.Item>
{isPivotTable && (
<Menu.Item
key={MenuKeys.ExportPivotCsv}
icon={<Icons.FileOutlined css={dropdownIconsStyles} />}
>
{t('Export to Pivoted .CSV')}
</Menu.Item>
)}
<Menu.Item
key={MenuKeys.ExportXlsx}
icon={<Icons.FileOutlined css={dropdownIconsStyles} />}
>
{t('Export to Excel')}
</Menu.Item>
{isFeatureEnabled(FeatureFlag.AllowFullCsvExport) &&
props.supersetCanCSV &&
isTable && (
<>
<Menu.Item
key={MenuKeys.ExportFullCsv}
icon={<Icons.FileOutlined css={dropdownIconsStyles} />}
>
{t('Export to full .CSV')}
</Menu.Item>
<Menu.Item
key={MenuKeys.ExportFullXlsx}
icon={<Icons.FileOutlined css={dropdownIconsStyles} />}
>
{t('Export to full Excel')}
</Menu.Item>
</>
)}
<Menu.Item
key={MenuKeys.DownloadAsImage}
icon={<Icons.FileImageOutlined css={dropdownIconsStyles} />}
>
{t('Download as image')}
</Menu.Item>
</Menu.SubMenu>
)}
```
You should also update the permission label in the relevant part of your
codebase where permissions are defined and checked, such as in
`superset/constants.py` and `superset/security/manager.py`
<sup>[[1]](https://github.com/apache/superset/blob/master/superset-frontend/src/dashboard/components/SliceHeaderControls/index.tsx)</sup><sup>[[2]](https://github.com/apache/superset/blob/master/superset/constants.py)</sup><sup>[[3]](https://github.com/apache/superset/blob/master/superset/security/manager.py)</sup>.
<!-- Dosu Comment Footer -->
*To continue talking to [Dosu](https://dosu.dev), mention @dosu.*
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]