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):
| Role | DB Value | Description |
|---|---|---|
| Owner | owner | One per org. Created when the client admin accepts the onboarding invite. Full control. Can transfer ownership. Cannot be removed โ only via ownership transfer. |
| Admin | admin | Can invite/remove members, change roles (up to Admin), manage channels, manage billing. |
| Billing | billing | View/manage billing only. For CFOs and finance team. Cannot invite or manage channels. |
| Member | member | Default role. Can use chat. Can view team list (read-only). Cannot manage anything. |
Role Permissions Matrixโ
| Section | Member | Billing | Admin | Owner |
|---|---|---|---|---|
| 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โ
| Action | Method | Endpoint | Auth |
|---|---|---|---|
| List members | GET | /admin/members | org_admin, superadmin |
| Invite member | POST | /admin/members/invite | org_admin, superadmin |
| Change member role | PATCH | /admin/members/:id/role | org_admin, superadmin |
| Remove member | DELETE | /orgs/:orgId/members/:userId | OrgRolesGuard("admin") |
| Transfer ownership | POST | /orgs/:orgId/transfer-ownership | OrgRolesGuard("owner") |
Role Derivationโ
orgRoleis stored inorg_memberships.org_role(TypeORM:OrgMembership.orgRole)- Valid values:
"owner" | "admin" | "member" | "billing"(TypeScript:OrgRoletype) - JWT payload:
orgMemberships[0].orgRole platformRolefor client users:"client_admin"(when orgRole=admin|owner) or"client_member"โ see CLAUDE.md role table. (Legacyorg_admin/org_memberstrings remain readable for back-compat; new code/UX copy usesclient_*.)
/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
NotificationBelldropdown +/v1/notificationsAPI) 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โ
| Page | Route | Roles | Status |
|---|---|---|---|
| Profile | /client/settings/profile | All | โ Live |
| Team | /client/settings/team | All (manage: Admin/Owner) | โ Live |
| Channels | /client/settings/channels | Admin, Owner | โ Live |
| Billing | /client/settings/billing | Admin, Owner, Billing | โ Live |
| Notifications | /client/settings/notifications | All | ๐ฎ Planned |
| Security | /client/settings/security | All | ๐ฎ Planned |
| API Access | /client/settings/api-access | Admin, Owner | ๐ฎ Planned |
Navigation Rulesโ
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/:userIdfor 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