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

DatasetAccessDeniedError is raised by DatasetWarmUpCacheCommand.validate() when security_manager.raise_for_access(datasource=table) throws a SupersetSecurityException. Unlike the editorship errors, this is a read-level access check: the user must be able to access the datasource (via dataset access, database access, RLS-permitting rules, or all-datasource-access) for cache warming to proceed.

Source

Thrown at superset/commands/dataset/warm_up_cache.py:73

            ).run()
            for chart in self._charts
        ]

    def validate(self) -> None:
        table = (
            db.session.query(SqlaTable)
            .join(Database)
            .filter(
                Database.database_name == self._db_name,
                SqlaTable.table_name == self._table_name,
            )
        ).one_or_none()
        if not table:
            raise WarmUpCacheTableNotFoundError()
        try:
            security_manager.raise_for_access(datasource=table)
        except SupersetSecurityException as ex:
            raise DatasetAccessDeniedError() from ex
        self._charts = (
            db.session.query(Slice)
            .filter_by(datasource_id=table.id, datasource_type=table.type)
            .all()
        )

View on GitHub (pinned to f4587218dd)

Solutions

  1. Grant the user's role 'datasource access on <db>.<schema>.<table>' (or database access / all-datasource-access for broader needs).
  2. Run warm-up as an Admin or a user who can already explore that dataset.
  3. Verify access beforehand with a explore/data-context call or security_manager.can_access_datasource.

Example fix

# before
POST /api/v1/dataset/warm_up_cache  (auth: gamma_limited)
# -> You don't have access to this dataset.

# after: grant in Roles -> Action menus, or
client.post("/api/v1/permission/add", ...)  # add datasource access grant, then retry
Defensive patterns

Strategy: validation

Validate before calling

from superset import security_manager

table = find_dataset(db_name, table_name)
try:
    security_manager.raise_for_access(datasource=table)
except SupersetSecurityException:
    request_datasource_grant(table)

Try / catch

try:
    DatasetWarmUpCacheCommand(db_name, table_name, dashboard_id, None).run()
except DatasetAccessDeniedError:
    skip_and_log(db_name, table_name)  # batch warmers: continue with others

Prevention

When it happens

Trigger: POST /api/v1/dataset/warm_up_cache for a dataset the user has no datasource access to — e.g. a Gamma user restricted by 'datasource access' grants that don't include this table.

Common situations: Onboarding scripts warming caches for all datasets with a limited service account. Users who can see charts (embedded) but lack direct dataset access trying to trigger warm-up. RLS rules that effectively deny the datasource.

Related errors


AI-assisted analysis of apache/superset@f4587218dd (2026-08-14). Data as JSON: /api/errors/ba5bd8af0981cad3. Report an issue: GitHub.