Repository navigation
Add per-user ownership check to dashboard load/update/delete - #1378
Merged
xuwei-fit2cloud merged 1 commit intoSep 17, 2026
Merged
Conversation
Dashboard resource endpoints (load_resource, update_resource, update_canvas, delete_resource) fetched a core_dashboard row by id alone, with no check that the caller created it. The only gating decorator verified workspace membership, not per-user ownership, so any authenticated workspace member could read, rename, or delete any other member's dashboard by id. list_resource already filters by create_by, showing dashboards are meant to be private per creator; this adds the same check to the other four code paths.
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.
Fixes #1377
Adds a per-user ownership check (
create_byvs. the caller's own id) toload_resource,update_resource,update_canvas, anddelete_resourceinapps/dashboard/crud/dashboard_service.py, matching the checklist_resourcealready applies when listing dashboards. Previously these four functions fetched acore_dashboardrow by id alone, and the only gating decorator (require_permissions(type='dashboard', ...)) only verified workspace membership rather than per-user ownership, allowing any authenticated member of a workspace to read, rename, or delete any other member's dashboard.load_resource_apinow passescurrent_userthrough toload_resourceso the ownership check has the caller's identity available.