justinpark commented on code in PR #29654:
URL: https://github.com/apache/superset/pull/29654#discussion_r1746286537
##########
superset-frontend/src/components/FilterableTable/index.tsx:
##########
@@ -249,11 +257,16 @@ const FilterableTable = ({
}),
}));
+ const canExportData = useSelector((state: RootState) =>
+ findPermission('can_export_csv', 'SQLLab', state.user?.roles),
+ );
+
Review Comment:
The FilterableTable is a common component, so accessing the Redux user state
to check permissions is not an appropriate approach. (Additionally, if
FilterableTable is used outside of SQLLab, this permission logic would be
incorrect.)
Therefore, it would be more appropriate to add a prop to FilterableTable
(e.g., disableTextSelection?: boolean) and include this logic in
SqlLab/components/ResultSet, passing it to FilterableTable.
--
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]