apache/superset · error · DatasetAccessDeniedError
You don't have access to this dataset.
Error message
You don't have access to this dataset.
What it means
After a dataset is imported (or matched), import_dataset calls security_manager.raise_for_access(datasource=dataset) unless ignore_permissions is set. If the importing user lacks access to the dataset's database/schema/table per the RBAC/RLS rules, SupersetSecurityException is converted to DatasetAccessDeniedError ('You don't have access to this dataset.').
Source
Thrown at superset/commands/dataset/importers/v1/utils.py:511
# visibility filter so a soft-deleted duplicate can be located
# too — without the bypass the listener would hide the row and
# the ``.one()`` would raise NoResultFound, masking the
# original MultipleResultsFound.
dataset = (
db.session.query(SqlaTable)
.execution_options(**{SKIP_VISIBILITY_FILTER_CLASSES: {SqlaTable}})
.filter_by(uuid=config["uuid"])
.one()
)
if dataset.id is None:
db.session.flush()
if not ignore_permissions:
try:
security_manager.raise_for_access(datasource=dataset)
except SupersetSecurityException as ex:
raise DatasetAccessDeniedError() from ex
try:
table_exists = dataset.database.has_table(
Table(dataset.table_name, dataset.schema, dataset.catalog),
)
except Exception: # pylint: disable=broad-except
# MySQL doesn't play nice with GSheets table names
logger.warning(
"Couldn't check if table %s exists, assuming it does", dataset.table_name
)
table_exists = True
if data_uri and (not table_exists or force_data):
load_data(data_uri, dataset, dataset.database)
if user:
from superset.subjects.utils import get_user_subject
View on GitHub (pinned to f4587218dd)
Solutions
- Grant the importing user's role access to the target database (and schema/dataset) via Settings → Database / Roles, then retry
- Import a bundle whose datasets reference databases the user can access
- Run the import as a user with the appropriate data-access grants
Defensive patterns
Strategy: try-catch
Validate before calling
from superset import security_manager
# pre-flight: confirm the current user can access every database referenced by the bundle
for cfg in dataset_configs:
db = session.query(Database).filter_by(id=cfg['database_id']).first()
security_manager.raise_for_access(database=db) # raises before any import work Try / catch
from superset.commands.dataset.exceptions import DatasetAccessDeniedError
try:
import_dataset(config)
except DatasetAccessDeniedError:
# grant database/schema access to the user's role, or import a bundle they can access
... Prevention
- Scope import bundles to databases the importing role can access
- Grant database access before distributing bundles built on new sources
- Remember RLS rules also apply on import — test with the importing user's role
When it happens
Trigger: A user imports a bundle referencing a database or schema they have no 'database access'/'schema access' grant for (or RLS rules deny it); common when analysts import bundles built on data sources outside their grants.
Common situations: Importing example or shared bundles that point at restricted databases; role missing can_access on the target database; RLS rules rejecting the user on the dataset's table.
Related errors
- Dataset {existing.table_name!r} (uuid {config['uuid']}) was
- Dataset doesn't exist and user doesn't have permission to cr
- Dataset {existing.table_name!r} (uuid {config['uuid']}) alre
- Dataset {existing.table_name!r} (uuid {config['uuid']}) alre
- Cannot convert node type: ${node.type}
AI-assisted analysis of apache/superset@f4587218dd (2026-08-14).
Data as JSON: /api/errors/9cb0b494ac72ea27.
Report an issue: GitHub.