Skip to content

Users settings page (replaces standalone users app)#750

Open
cyberb wants to merge 20 commits into
masterfrom
users-settings-page
Open

Users settings page (replaces standalone users app)#750
cyberb wants to merge 20 commits into
masterfrom
users-settings-page

Conversation

@cyberb

@cyberb cyberb commented Jun 12, 2026

Copy link
Copy Markdown
Member

Summary

Adds a built-in Users settings page to the platform UI, replacing the need for the standalone users snap app (ldap-user-manager). Everything is managed directly against the platform's OpenLDAP via the Go backend.

Features:

  • Add / remove users with username + password.
  • Admin switch per user — toggles membership in the syncloud posix group (the platform's admin group). Guards against removing the last admin.
  • Email field — critical for OIDC claims. Never saved empty: defaults to <username>@<device-domain>, or a custom address that must be a valid email. Editable per existing user.
  • Arbitrary groups — create/remove posix groups and toggle per-user membership (the syncloud admin group is managed via the dedicated admin switch and excluded from the group list).
  • OIDC email claim enabled — uncommented mail: mail in the Authelia LDAP attribute mapping so apps that require the email claim can log in (previously the claim was never emitted).

Backend (backend/)

  • auth/ldap.go: new ListUsers, SetUserEmail, ListGroups, AddGroup, RemoveGroup, SetGroupMember, SetAdmin, ResolveEmail (default/validate, never empty). AddUser now takes an email. DomainProvider injected for the default-domain.
  • rest/backend.go: /rest/users, /rest/users/{add,remove,email,admin}, /rest/groups, /rest/groups/{add,remove,member} — all admin-secured.
  • ioc, CLI user add --email updated. Unit tests for email resolution.

Frontend (web/platform/)

  • New views/Users.vue, route, Settings tile, i18n keys across all 10 locales.
  • Dev stub (src/stub/api.js) implements the new endpoints so the page works without a backend (npm run dev).

Tests

  • Go: auth/rest/ioc pass. New ResolveEmail unit tests.
  • Web: jest (incl. locale key-parity) + lint + build pass.
  • e2e: specs/10-users.spec.ts — add user (default email), edit email, admin switch, group create + membership, removal.

Notes

cyberb added 20 commits June 12, 2026 22:26
… jest unit tests for users list/edit screens
…red endpoints

Mirror the backend's per-endpoint admin checks in the UI: routes whose
data comes only from AdminSecuredHandle endpoints (access, internalmemory,
storage, updates, backup, certificate, certificate/log, health) now carry
meta.admin and their Settings tiles render only for admins. Pages served
via SecuredHandle (network, support, logs, customproxy, system) and the
mixed read-secured/write-admin pages (activation, twofactor, locale) stay
visible to regular users.
Jest Settings.spec asserts the tile gating both ways (non-admin sees
locale/twofactor and the user-facing tiles, never the admin tiles; admin
sees all). Playwright 11-nonadmin-settings creates a non-admin user via the
platform CLI, logs in, and confirms locale and two-factor open while admin
tiles (storage, users) are absent.
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.

1 participant