hughhhh commented on a change in pull request #18953:
URL: https://github.com/apache/superset/pull/18953#discussion_r829262668



##########
File path: superset-frontend/src/views/CRUD/data/database/DatabaseList.tsx
##########
@@ -171,8 +187,50 @@ function DatabaseList({ addDangerToast, addSuccessToast }: 
DatabaseListProps) {
   const canExport =
     hasPerm('can_export') && isFeatureEnabled(FeatureFlag.VERSIONED_EXPORT);
 
+  const { canUploadCSV, canUploadColumnar, canUploadExcel } =
+    uploadUserPerms(roles);
+
+  const uploadDropdownMenu = [
+    {
+      label: t('Upload file to database'),
+      childs: [
+        {
+          label: t('Upload CSV'),
+          name: 'Upload CSV file',
+          url: '/csvtodatabaseview/form',
+          perm:
+            checkUploadExtensions(CSV_EXTENSIONS, ALLOWED_EXTENSIONS) &&

Review comment:
       might as well combine these inside `uploadUserPerms` mapping function in 
the utils




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