Repository navigation
Conversation
Contributor
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #46142 +/- ##
=======================================
Coverage 65.35% 65.35%
=======================================
Files 3083 3083
Lines 211224 211286 +62
Branches 49803 49814 +11
=======================================
+ Hits 138054 138095 +41
- Misses 69992 70006 +14
- Partials 3178 3185 +7
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
…rmission Align ImportAssetsCommand with import_dashboard: only reassign an existing dashboard's chart associations from the bundle position when the caller may write that dashboard (can_write grant plus editor/admin, or a request-less background path). Newly created dashboards are unaffected because the caller is registered as their editor, and dashboards the caller may edit behave as before. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
sha174n
force-pushed
the
harden/import-dashboard-slices-writecheck
branch
from
November 11, 2026 11:49
51708ee to
4a3e357
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Make
ImportAssetsCommand's dashboard chart-association handling consistent withimport_dashboard.import_dashboardapplies a per-object write check and returns an existing dashboard unchanged when the caller is not permitted to write it; the bulk-assets path reassignsdashboard.slicesfrom the bundle position and should honor the same check.This adds a module helper
_can_write_dashboardthat mirrorsimport_dashboard's permission model (thecan_writegrant onDashboard, plus editor/admin on an already-persisted dashboard, with the request-less background / example-loader path allowed), and guards the slice reassignment with it.Scope / notes
import_dashboardregisters the caller as their editor before this block runs, so the check passes and slices are assigned as before.migrate_dashboard()and tag-import blocks are separate concerns and remain as-is.Testing
Added
test_import_without_write_permission_keeps_existing_dashboard_charts. Fullassets_test.pyunit suite passes locally.