Show inquiry download to any logged-in user + add Data-eigenaar field#258
Merged
Conversation
… (#973) The download button in the Onderzoeksinformatie panel was gated on isOrgAvailable(attribution.owner) — the user had to be a member of the report's owning org. Historical data sits under scattered legacy orgs, so this hid the button for almost everyone. The API already serves /api/inquiry/:id/download ownership-agnostically (#968), so the gate only hid a file that was already reachable. Gate on isAuthenticated instead. Also surface the requested "Data-eigenaar" field in the panel. It is wired forward-compatibly through the adapter: it reads attribution_data_owner_name when the API exposes it, otherwise falls back to the owning org. Repoint the source once report.inquiry.data_owner_organization_id ships (#973 epic). Co-Authored-By: Claude Opus 4.8 (1M context) <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.
Context
Quick-win slice of Laixer/FunderMaps#973 (data ownership), addressing the two concrete points Don raised in the issue comments. Also related: Laixer/FunderMaps#968 (ownership-agnostic inquiry access — backend already shipped).
This is WebFront-only; no schema or API changes.
What & why
1. Download button now shows for any logged-in user
The button in the Onderzoeksinformatie panel was gated on
isOrgAvailable(attribution.owner)— you had to be a member of the report's owning org. Historical data sits under scattered legacy orgs, so this hid the button for almost everyone.The API already serves
/api/inquiry/:id/downloadownership-agnostically (#968), so the gate only ever hid a file that was already reachable. No new exposure — this just aligns the UI with what the backend already allows. Now gated onisAuthenticated.2. "Data-eigenaar" field added to the panel
Wired forward-compatibly through the adapter: reads
attribution_data_owner_namewhen the API exposes it, otherwise falls back to the owning org. Today it shows the owning organisation (the de-facto data owner); oncereport.inquiry.data_owner_organization_idships in the epic, the adapter auto-picks up the corrected value — no further frontend change needed.Heads-up — access-rule decision
This deliberately softens #973's "only the owning org may download" to #968's "any logged-in user." That choice is what actually unblocks Don now; proper owner-gating only becomes meaningful after the backfill corrects who the owner is, and belongs in the
data_owner_organization_idepic. Code comments note this.Test
npx vue-tsc --noEmit— clean.pnpm dev.🤖 Generated with Claude Code