mirror of
https://github.com/apache/superset.git
synced 2026-04-22 01:24:43 +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:
@@ -23,6 +23,7 @@ from sqlalchemy import and_, Boolean, Column, Integer, String, Text
|
||||
from sqlalchemy.ext.declarative import declared_attr
|
||||
from sqlalchemy.orm import foreign, Query, relationship, RelationshipProperty
|
||||
|
||||
from superset import security_manager
|
||||
from superset.constants import NULL_STRING
|
||||
from superset.models.helpers import AuditMixinNullable, ImportMixin, QueryResult
|
||||
from superset.models.slice import Slice
|
||||
@@ -496,6 +497,15 @@ class BaseDatasource(
|
||||
return NotImplemented
|
||||
return self.uid == other.uid
|
||||
|
||||
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(datasource=self)
|
||||
|
||||
|
||||
class BaseColumn(AuditMixinNullable, ImportMixin):
|
||||
"""Interface for column"""
|
||||
|
||||
Reference in New Issue
Block a user