You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2022/04/01 16:24:49 UTC

[GitHub] [superset] AAfghahi commented on a change in pull request #19051: fix: update Permissions for right nav

AAfghahi commented on a change in pull request #19051:
URL: https://github.com/apache/superset/pull/19051#discussion_r840743261



##########
File path: superset/databases/filters.py
##########
@@ -51,3 +57,37 @@ def apply(self, query: Query, value: Any) -> Query:
                 ),
             )
         )
+
+
+class DatabaseUploadEnabledFilter(BaseFilter):  # pylint: disable=too-few-public-methods
+    """
+    Custom filter for the GET list that filters all certified charts
+    """
+
+    name = _("Upload Enabled")
+    arg_name = "upload_is_enabled"
+    model = Database
+
+    def apply(self, query: Query, value: any) -> Query:
+        extra_allowed_databases = []
+        if hasattr(g, "user"):
+            extra_allowed_databases += app.config["ALLOWED_USER_CSV_SCHEMA_FUNC"](
+                Database, g.user
+            )
+        if len(extra_allowed_databases):

Review comment:
       Added. 




-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org