mirror of
https://github.com/apache/superset.git
synced 2026-04-20 08:34:37 +00:00
feat: implement csv upload configuration func for the schema enforcement (#9734)
* Implement csv upload func for schema enforcement Implement function controlled csv upload schema Refactor + fix tests Fixing hive as well * Add explore_db to the extras Co-authored-by: bogdan kyryliuk <bogdankyryliuk@dropbox.com>
This commit is contained in:
@@ -609,7 +609,13 @@ class Database(
|
||||
def get_schema_access_for_csv_upload( # pylint: disable=invalid-name
|
||||
self,
|
||||
) -> List[str]:
|
||||
return self.get_extra().get("schemas_allowed_for_csv_upload", [])
|
||||
allowed_databases = self.get_extra().get("schemas_allowed_for_csv_upload", [])
|
||||
if hasattr(g, "user"):
|
||||
extra_allowed_databases = config["ALLOWED_USER_CSV_SCHEMA_FUNC"](
|
||||
self, g.user
|
||||
)
|
||||
allowed_databases += extra_allowed_databases
|
||||
return sorted(set(allowed_databases))
|
||||
|
||||
@property
|
||||
def sqlalchemy_uri_decrypted(self) -> str:
|
||||
|
||||
Reference in New Issue
Block a user