rusackas commented on code in PR #41799:
URL: https://github.com/apache/superset/pull/41799#discussion_r3540307065


##########
superset-frontend/src/utils/findPermission.ts:
##########
@@ -26,3 +27,15 @@ export const findPermission = memoizeOne(
       permissions.some(([perm_, view_]) => perm_ === perm && view_ === view),
     ),
 );
+
+/**
+ * Whether the user may download chart data (CSV, Excel). With
+ * GranularExportControls enabled this checks the granular can_export_data
+ * permission but keeps can_csv as a fallback, so turning the flag on never
+ * silently removes access a user already had.
+ */
+export const canDownloadData = (roles?: UserRoles | null) =>

Review Comment:
   While you're in here, this could take an explicit return type to keep the 
no-`any` push happy:
   ```suggestion
   export const canDownloadData = (roles?: UserRoles | null): boolean =>
   ```



-- 
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]

Reply via email to