mirror of
https://github.com/apache/superset.git
synced 2026-04-20 16:44:46 +00:00
Adding permission for can_only_access_owned_queries (#7234)
* Adding permission for can_only_access_owned_queries * Fixing lint adding typing to variable * Adding test for queryview and enabling /queryview/api/read * Fixing issues with python typing
This commit is contained in:
@@ -138,6 +138,14 @@ class Query(Model, ExtraJSONMixin):
|
||||
tab = re.sub(r'\W+', '', tab)
|
||||
return f'sqllab_{tab}_{ts}'
|
||||
|
||||
@property
|
||||
def database_name(self):
|
||||
return self.database.name
|
||||
|
||||
@property
|
||||
def username(self):
|
||||
return self.user.username
|
||||
|
||||
|
||||
class SavedQuery(Model, AuditMixinNullable, ExtraJSONMixin):
|
||||
"""ORM model for SQL query"""
|
||||
|
||||
Reference in New Issue
Block a user