Split dashboard.view/dashboard.manage permissions; harden query guard - #10
Merged
Merged
Conversation
… guard
Every dashboard route was gated on broad, unrelated permissions
(projects.read/projects.write/users.write) instead of anything
dashboard-specific. Introduced dashboard.view and dashboard.manage
custom permissions, each available at both project and global scope,
and gated every route and the sidebar nav entries with them.
dashboard.manage implies dashboard.view for loading purposes.
Also hardens validateProjectScopePlaceholder in query_guard.go: the
{{project_id}} filter previously just had to appear somewhere in a
WHERE/ON/HAVING clause, which a duplicated/self-compared placeholder,
a non-equality operator, or a sibling bare OR could all short-circuit
into matching across every project. It must now appear exactly once,
as a direct equality filter, with no bare OR anywhere in the query.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Minor bump: introduces dashboard.view/dashboard.manage permissions, replacing the projects.read/projects.write/users.write checks these routes used before (existing role grants will need to add them). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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
Every dashboard route was gated on broad, unrelated permissions (
projects.read/projects.write/users.write) instead of anything dashboard-specific. Introduceddashboard.viewanddashboard.managecustom permissions — each available at both project and global scope — and gated every route and the sidebar nav entries with them.dashboard.manageimpliesdashboard.viewfor loading purposes, so a manage-only role isn't blocked from the page itself.Also hardens
validateProjectScopePlaceholderinquery_guard.go: the{{project_id}}filter previously just had to appear somewhere in aWHERE/ON/HAVINGclause, which a duplicated/self-compared placeholder, a non-equality operator, or a sibling bareORcould all short-circuit into matching across every project. It must now appear exactly once, as a direct equality filter, with no bareORanywhere in the query. See the updated "Authorization" and query-guard sections inREADME.mdfor the full picture.Versioning
Bumped to
0.4.0(minor) rather than a patch bump, sincedashboard.view/dashboard.managereplace existing permission checks — an installation with roles scoped to the old permissions for dashboard access will need to grant the new ones instead.Verification
go test ./...andgo vet ./...pass, including new regression tests for the permission split and the query-guard hardening.🤖 Generated with Claude Code