Skip to main content

Client Settings โ€” Implemented Spec

Last updated: 2026-05-04 Status: Core pages live (โœ… Profile, Team, Channels, Billing); Notifications/Security/API Access planned.

Overviewโ€‹

The client settings area (/client/settings/*) provides workspace configuration for all client org roles. It is role-gated: what you see in the sidebar and what you can do depends on your workspace role.


Workspace Rolesโ€‹

humanwork uses a 4-tier role model (Slack-inspired):

RoleDB ValueDescription
OwnerownerOne per org. Created when the client admin accepts the onboarding invite. Full control. Can transfer ownership. Cannot be removed โ€” only via ownership transfer.
AdminadminCan invite/remove members, change roles (up to Admin), manage channels, manage billing.
BillingbillingView/manage billing only. For CFOs and finance team. Cannot invite or manage channels.
MembermemberDefault role. Can use chat. Can view team list (read-only). Cannot manage anything.

Role Permissions Matrixโ€‹

SectionMemberBillingAdminOwner
Profile (edit own)โœ…โœ…โœ…โœ…
Team (view)โœ…โœ…โœ…โœ…
Team (invite/remove/change roles)โŒโŒโœ…โœ…
Team (transfer ownership)โŒโŒโŒโœ…
ChannelsโŒโŒโœ…โœ…
BillingโŒโœ…โœ…โœ…

Settings Navigationโ€‹

The sidebar shows/hides items based on orgRole from the JWT:

Profile      โ†’ always visible
Team โ†’ always visible (read-only for Member/Billing)
Channels โ†’ Owner, Admin only
Billing โ†’ Owner, Admin, Billing only

Pagesโ€‹

/client/settings/profileโ€‹

  • Edit display name, avatar, phone, title, bio
  • All roles

/client/settings/teamโ€‹

  • View all workspace members: Avatar | Name | Email | Role badge | Joined date
  • Role badges: Owner (gold), Admin (blue), Billing (purple), Member (gray)
  • Admin/Owner only: "+ Invite Member" button, role change dropdown per row, "Remove" button
  • Owner row: no actions (immune to removal; role only changes via transfer-ownership)
  • Self row: highlighted, "(you)" label, no remove button
  • Cannot demote the only Admin/Owner (guard enforced client-side + server-side)
  • Owner-only section (bottom): Transfer Ownership modal โ†’ select new owner from existing members
  • Non-owner section (bottom): Leave Workspace (stub โ€” contact admin to implement)

/client/settings/channelsโ€‹

  • Admin/Owner only
  • Manage WhatsApp/email/Slack channel connections
  • (Phase 2 โ€” stub placeholder for now)

/client/settings/billingโ€‹

  • Owner, Admin, Billing roles
  • View plan, usage, renewal date
  • Manage payment method

API Endpoints Usedโ€‹

ActionMethodEndpointAuth
List membersGET/admin/membersorg_admin, superadmin
Invite memberPOST/admin/members/inviteorg_admin, superadmin
Change member rolePATCH/admin/members/:id/roleorg_admin, superadmin
Remove memberDELETE/orgs/:orgId/members/:userIdOrgRolesGuard("admin")
Transfer ownershipPOST/orgs/:orgId/transfer-ownershipOrgRolesGuard("owner")

Role Derivationโ€‹

  • orgRole is stored in org_memberships.org_role (TypeORM: OrgMembership.orgRole)
  • Valid values: "owner" | "admin" | "member" | "billing" (TypeScript: OrgRole type)
  • JWT payload: orgMemberships[0].orgRole
  • platformRole for client users: "client_admin" (when orgRole=admin|owner) or "client_member" โ€” see CLAUDE.md role table. (Legacy org_admin / org_member strings remain readable for back-compat; new code/UX copy uses client_*.)

/client/settings/notifications (planned)โ€‹

  • Notification preferences: email digest frequency (immediate / daily / weekly / off), browser push opt-in.
  • All roles.
  • Planned โ€” UI stub; no dedicated endpoint yet (preferences stored on User entity in future iteration).
  • Cross-ref: The in-app notification feed itself (the NotificationBell dropdown + /v1/notifications API) shipped via #915 (AppNotification entity + WS push). The settings page below controls delivery channels / digest cadence for that feed; the feed UI is already live for all roles.

/client/settings/security (planned)โ€‹

  • Change password, active sessions list, revoke sessions.
  • 2FA setup (TOTP via otplib โ€” API already supports POST /auth/2fa/setup + POST /auth/2fa/verify).
  • All roles.
  • Planned โ€” API endpoints exist; settings page not yet built.

/client/settings/api-access (planned)โ€‹

  • View and manage API keys / webhook secrets for the org's integration.
  • Admin, Owner only.
  • Planned โ€” Future; requires API key management endpoints.

Full Settings Suiteโ€‹

PageRouteRolesStatus
Profile/client/settings/profileAllโœ… Live
Team/client/settings/teamAll (manage: Admin/Owner)โœ… Live
Channels/client/settings/channelsAdmin, Ownerโœ… Live
Billing/client/settings/billingAdmin, Owner, Billingโœ… Live
Notifications/client/settings/notificationsAll๐Ÿ”ฎ Planned
Security/client/settings/securityAll๐Ÿ”ฎ Planned
API Access/client/settings/api-accessAdmin, Owner๐Ÿ”ฎ Planned

The settings sidebar is role-gated:

Profile        โ†’ always visible (all roles)
Team โ†’ always visible (read-only for Member/Billing)
Channels โ†’ Owner, Admin only
Billing โ†’ Owner, Admin, Billing only
Notifications โ†’ all roles (planned)
Security โ†’ all roles (planned)
API Access โ†’ Owner, Admin only (planned)

Route guard: if a lower-privileged role navigates directly to a hidden route (e.g., /client/settings/channels), the settings layout redirects to /client/settings/profile.


Future Workโ€‹

  • Leave workspace API โ€” DELETE /orgs/:orgId/members/:userId for self-removal (currently only admins can remove others; self-removal not implemented)
  • Resend invite โ€” allow admins to resend pending invites
  • Revoke invite โ€” allow admins to cancel pending invites