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

@@ -286,3 +286,12 @@ class QueryContext:
"stacktrace": stacktrace,
"rowcount": len(df.index),
}
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_context=self)