Skip to content

fix(website): show 403 error instead of 404 when editing unowned collection - #1323

Merged
fhennig merged 4 commits into
mainfrom
fix/collection-edit-403-not-owner
Jul 9, 2026
Merged

fix(website): show 403 error instead of 404 when editing unowned collection#1323
fhennig merged 4 commits into
mainfrom
fix/collection-edit-403-not-owner

Conversation

@fhennig

@fhennig fhennig commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

resolves #1160

Summary

  • Visiting collections/<id>/edit for a collection you don't own previously returned a generic 404 redirect
  • Now returns a proper 403 HTTP status and renders a friendly "Not authorized" error page

…ection

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@vercel

vercel Bot commented Jul 8, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
dashboards Ready Ready Preview, Comment Jul 8, 2026 1:22pm

Request Review

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the collections edit route in the Astro frontend so that authenticated users who try to edit a collection they don’t own receive an explicit 403 Not Authorized response (instead of a 404 redirect), and adds an e2e regression test to lock this behavior in.

Changes:

  • Return HTTP 403 (and render a “Not authorized” page state) when a logged-in non-owner visits collections/<org>/<id>/edit.
  • Add a Playwright e2e test asserting the 403 status and “Not authorized” heading for non-owners.
  • Minor refactor in the edit page render branching to handle the new unauthorized state.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
website/tests/collections/collectionForm.spec.ts Adds an e2e test covering the new 403 “Not authorized” behavior for non-owners.
website/src/pages/collections/[pathFragment]/[id]/edit.astro Sets Astro.response.status = 403 for authenticated non-owners and renders an unauthorized page state.

Comment thread website/src/pages/collections/[pathFragment]/[id]/edit.astro
Comment thread website/src/pages/collections/[pathFragment]/[id]/edit.astro
@fhennig
fhennig merged commit d9ccbb2 into main Jul 9, 2026
13 checks passed
@fhennig
fhennig deleted the fix/collection-edit-403-not-owner branch July 9, 2026 09:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

collections: when opening the edit form for a collection you don't own, inform user that it's not possible

3 participants