feat(hub): decouple systems from user for role-based access control#2004
Open
svenvg93 wants to merge 5 commits into
Open
feat(hub): decouple systems from user for role-based access control#2004svenvg93 wants to merge 5 commits into
svenvg93 wants to merge 5 commits into
Conversation
- Remove users option in the dorpdown nav
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.
📃 Description
Decouples systems from per-user ownership. Previously each system record had a
usersrelation field controlling who could see it. This PR removes that field and adopts a role-based model: all authenticated users can view all systems, only admins can create/edit/delete them. A new in-app user management page replaces the need to use the PocketBase admin UI for user administration.closes #1856
🪵 Changelog
➕ Added
admin(full control),user(read-only),readonly(read-only, no tokens/fingerprints page)2_user_email_visibility— setsemailVisibility = truefor all existing users so admins can list them✏️ Changed
adminrole users can create, update, delete, or pause systemsGET /api/beszel/universal-token) now requires admin rolereadonly)config.ymlusersfield per system removed — systems are globally visible, no per-system user assignment neededverifiedandemailVisibility = trueon creation🔧 Fixed
readonlyusers (desktop already did this)requireAdminRolemiddleware now passes superusers through to endpoint handlers so they receive their specific error messages rather than a generic 403USER_CREATION=true(OAuth2 mode) create rule now correctly takes precedence over the admin create rule on the users collection🗑️ Removed
usersrelation field fromsystemscollection (migration1_system_access)system_accessjoin collection and all associated code (agent connect, config sync, alert targeting, frontend)SHARE_ALL_SYSTEMSenvironment variable — all systems are now shared by defaultconfig.ymlper-systemuserslist — no longer needed📷 Screenshots