{"record":{"id":"1c6a10de3730711e","repo":"apache/superset","slug":"a-dashboard-already-exists-and-user-doesn-t-have-p-1c6a10","errorCode":null,"errorMessage":"A dashboard already exists and user doesn't have permissions to overwrite it","messagePattern":"A dashboard already exists and user doesn't have permissions to overwrite it","errorType":"exception","errorClass":"ImportFailedError","httpStatus":500,"severity":"error","filePath":"superset/commands/dashboard/importers/v1/utils.py","lineNumber":421,"sourceCode":"            # though the upload was supposed to fix it.\n            if \"slug\" in config:\n                existing.slug = config[\"slug\"]\n            db.session.flush()\n            config[\"id\"] = existing.id\n        else:\n            # OVERWRITE path — existing alive row. Without ``overwrite`` or\n            # write permission, return it unchanged (the pre-soft-delete\n            # overwrite-without-permission behaviour).\n            if not overwrite or not can_write:\n                return existing\n            if user and (\n                not security_manager.can_access_dashboard(existing)\n                or (\n                    not security_manager.is_editor(existing)\n                    and not security_manager.is_admin()\n                )\n            ):\n                raise ImportFailedError(\n                    \"A dashboard already exists and user doesn't have \"\n                    \"permissions to overwrite it\"\n                )\n            config[\"id\"] = existing.id\n    elif not can_write:\n        raise ImportFailedError(\n            \"Dashboard doesn't exist and user doesn't \"\n            \"have permission to create dashboards\"\n        )\n\n    # TODO (betodealmeida): move this logic to import_from_dict\n    config = config.copy()\n\n    # removed in https://github.com/apache/superset/pull/23228\n    if \"metadata\" in config and \"show_native_filters\" in config[\"metadata\"]:\n        del config[\"metadata\"][\"show_native_filters\"]\n\n    # Note: theme_id handling moved to higher level import logic","sourceCodeStart":403,"sourceCodeEnd":439,"githubUrl":"https://github.com/apache/superset/blob/f4587218dd19d046c3e4d00063e7d27f8a2ed354/superset/commands/dashboard/importers/v1/utils.py#L403-L439","documentation":"ImportFailedError('A dashboard already exists and user doesn't have permissions to overwrite it') is raised in the v1 import OVERWRITE branch: the bundle's UUID matches a live dashboard, overwrite mode is enabled and can_write holds, but the user cannot access the existing dashboard or is neither its editor nor an admin. Overwriting an alive row requires editorship of that specific dashboard, not just generic import rights.","triggerScenarios":"Importing a v1 ZIP with overwrite=True whose dashboard UUID matches an existing live dashboard owned by someone else, while the importing user has import permission but not editorship of that dashboard.","commonSituations":"Central pipelines pushing updated dashboard bundles to environments where local teams own the dashboards; new team members re-importing shared bundles without being added as owners; cross-environment promotion tools using a generic import account.","solutions":["Add the importing user as an owner of the target dashboard (PUT /api/v1/dashboard/<id> with owners) before re-importing.","Perform the overwrite import as an admin.","Or import without overwrite into a new dashboard (change/remove the UUID) if divergence from the existing one is acceptable."],"exampleFix":"# before\nclient.post('/api/v1/dashboard/import/', data={'overwrite': 'true'}, ...)  # not editor\n\n# after\nadmin_client.put(f'/api/v1/dashboard/{id}', json={'owners': [user.id]})\nclient.post('/api/v1/dashboard/import/', data={'overwrite': 'true'}, files=...)","handlingStrategy":"try-catch","validationCode":"existing = find_existing_for_import(Dashboard, config['uuid'])\nuser = get_user()\nif existing is not None and existing.deleted_at is None and overwrite and user:\n    if not security_manager.can_access_dashboard(existing) or (\n        not security_manager.is_editor(existing)\n        and not security_manager.is_admin()\n    ):\n        raise PermissionError('overwrite import requires editorship of the target dashboard')","typeGuard":null,"tryCatchPattern":"try:\n    run_import(bundle, overwrite=True)\nexcept ImportFailedError as ex:\n    if \"permissions to overwrite\" in str(ex):\n        add_importer_as_owner(existing.id) or run_as_admin()","preventionTips":["Add the pipeline account as an owner of dashboards it is meant to overwrite.","Keep a single accountable owner role for promoted dashboards.","If overwrite rights are unavailable, import under a new UUID instead."],"tags":["security","rbac","import","overwrite","editorship"],"backgroundTag":null,"analyzedSha":"f4587218dd19d046c3e4d00063e7d27f8a2ed354","analyzedAt":"2026-08-14T22:39:27.425Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}