chore(security): Updating assert logic (#10034)

* chore(security): Updating assert logic

* Deprecating rejected_tables

Co-authored-by: John Bodley <john.bodley@airbnb.com>
This commit is contained in:
John Bodley
2020-06-23 20:49:39 -07:00
committed by GitHub
parent be936c2eb8
commit aefef9ca55
12 changed files with 282 additions and 147 deletions

View File

@@ -148,6 +148,15 @@ class Query(Model, ExtraJSONMixin):
def username(self) -> str:
return self.user.username
def raise_for_access(self) -> None:
"""
Raise an exception if the user cannot access the resource.
:raises SupersetSecurityException: If the user cannot access the resource
"""
security_manager.raise_for_access(query=self)
class SavedQuery(Model, AuditMixinNullable, ExtraJSONMixin):
"""ORM model for SQL query"""