mirror of
https://github.com/apache/superset.git
synced 2024-09-12 08:39:45 -04:00
Fixing out-of-sync security (#2493)
This commit is contained in:
parent
c3015583ce
commit
5574cfef59
@ -94,7 +94,6 @@ def get_or_create_main_db():
|
|||||||
)
|
)
|
||||||
if not dbobj:
|
if not dbobj:
|
||||||
dbobj = models.Database(database_name="main")
|
dbobj = models.Database(database_name="main")
|
||||||
logging.info(conf.get("SQLALCHEMY_DATABASE_URI"))
|
|
||||||
dbobj.set_sqlalchemy_uri(conf.get("SQLALCHEMY_DATABASE_URI"))
|
dbobj.set_sqlalchemy_uri(conf.get("SQLALCHEMY_DATABASE_URI"))
|
||||||
dbobj.expose_in_sqllab = True
|
dbobj.expose_in_sqllab = True
|
||||||
dbobj.allow_run_sync = True
|
dbobj.allow_run_sync = True
|
||||||
@ -147,6 +146,9 @@ def set_role(role_name, pvms, pvm_check):
|
|||||||
role = sm.add_role(role_name)
|
role = sm.add_role(role_name)
|
||||||
role_pvms = [p for p in pvms if pvm_check(p)]
|
role_pvms = [p for p in pvms if pvm_check(p)]
|
||||||
role.permissions = role_pvms
|
role.permissions = role_pvms
|
||||||
|
sesh = sm.get_session()
|
||||||
|
sesh.merge(role)
|
||||||
|
sesh.commit()
|
||||||
|
|
||||||
|
|
||||||
def create_custom_permissions():
|
def create_custom_permissions():
|
||||||
|
Loading…
Reference in New Issue
Block a user