mirror of
https://github.com/apache/superset.git
synced 2026-04-18 23:55:00 +00:00
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:
@@ -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"""
|
||||
|
||||
Reference in New Issue
Block a user