feat: viewer role with invite-based registration#67
Merged
akifbayram merged 10 commits intomainfrom Mar 7, 2026
Merged
Conversation
- Viewers cannot create bins (uses requireMemberOrAbove) - Viewers cannot edit bins; members can edit items on any bin but metadata only on bins they created - Viewers cannot pin bins - Viewers cannot upload photos - Added tests for all four restrictions
…ault join role setting
… and UI Add requireMemberOrAbove checks to batch operations, bin duplication, tag addition, and tag color management routes. Hide pin/duplicate/move actions from viewers in BinDetailToolbar, filter reorganize from sidebar for read-only users, and redirect viewers away from ReorganizePage.
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
Adds a viewer role to the existing admin/member permission model, along with invite-based registration and per-location default join role configuration.
Viewer Role
viewerrole inlocation_members(schema updated with 3-way check constraint)requireMemberOrAbovehelper in bin/photo routesusePermissionshook updated withcanEdit/isViewerflagsInvite-Based Registration
REGISTRATION_MODEenv var replacesREGISTRATION_ENABLED(open|invite|closed)invitemode requires a valid location invite code during registration — user auto-joins that locationinvite; hides register link whenclosedDefault Join Role
default_join_rolecolumn onlocationstable (memberorviewer)Member Management
Test Plan
REGISTRATION_MODE=inviteusing a valid invite code — verify auto-join with correct roleREGISTRATION_MODE=closed— verify registration is blockeddefault_join_role=viewer— verify viewer role assignednpx vitest run(client + server) — all tests pass