mirror of
https://github.com/apache/superset.git
synced 2026-04-20 00:24:38 +00:00
fix: Refactor ownership checks and ensure consistency (#20499)
Co-authored-by: John Bodley <john.bodley@airbnb.com>
This commit is contained in:
@@ -17,7 +17,6 @@
|
||||
import logging
|
||||
from typing import Optional
|
||||
|
||||
from flask_appbuilder.security.sqla.models import User
|
||||
from sqlalchemy.exc import SQLAlchemyError
|
||||
|
||||
from superset.datasets.commands.exceptions import DatasetNotFoundError
|
||||
@@ -34,8 +33,7 @@ logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class GetExplorePermalinkCommand(BaseExplorePermalinkCommand):
|
||||
def __init__(self, actor: User, key: str):
|
||||
self.actor = actor
|
||||
def __init__(self, key: str):
|
||||
self.key = key
|
||||
|
||||
def run(self) -> Optional[ExplorePermalinkValue]:
|
||||
@@ -55,7 +53,7 @@ class GetExplorePermalinkCommand(BaseExplorePermalinkCommand):
|
||||
datasource_type = DatasourceType(
|
||||
value.get("datasourceType", DatasourceType.TABLE)
|
||||
)
|
||||
check_chart_access(datasource_id, chart_id, self.actor, datasource_type)
|
||||
check_chart_access(datasource_id, chart_id, datasource_type)
|
||||
return value
|
||||
return None
|
||||
except (
|
||||
|
||||
Reference in New Issue
Block a user