eschutho commented on a change in pull request #19051: URL: https://github.com/apache/superset/pull/19051#discussion_r839934237
########## 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: looking at this now, we may want to add a comment that to keep this simple, we're not going to check to see if these schemas actually exist in any of the databases. -- 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-unsubscr...@superset.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: notifications-unsubscr...@superset.apache.org For additional commands, e-mail: notifications-h...@superset.apache.org