Org Users

A read-only view of all users in an organization, with filtering by role, project assignment, and search. This page provides administrators with visibility into their team and each user’s project involvement.

User List

The Users page (/org-dashboard/{orgId}/users) displays a paginated table of all org users with their roles, statuses, and project counts.

Table Columns

ColumnDescription
NameUser display name (bold)
EmailUser email (muted text)
RoleOrg role displayed as a badge (outline variant)
Statusactive (green), pending (gray), inactive (red)
ProjectsCount of projects the user is assigned to

Role Display

Role values are formatted for display: underscores replaced with spaces and each word capitalized. For example, organisational_manager becomes Organisational Manager.

Filters

ParameterTypeDescription
rolestringFilter by user role (dropdown with all 14 roles)
searchstringSubstring match on name or email (ILIKE)
project_idUUIDFilter to users assigned to a specific project
pageintPage number (default 1)
page_sizeintItems per page (default 25, max 100)

Role Filter Options

Master Admin, Org Manager, Project Manager, Foreman, Worker, Unassigned — and the full set of 14 roles defined in the user_role enum.

Query Strategy

Two query paths depending on filters:

FilterQuery UsedPagination
No projectListOrgUsersYes
With projectListOrgUsersByProjectNo (returns all)

The ListOrgUsers query includes a subquery for project_count:

SELECT u.*, (SELECT COUNT(*) FROM project_members pm WHERE pm.user_id = u.id)::int AS project_count
FROM users u
WHERE u.org_id = $1
  AND ($2::text = '' OR u.role = $2::user_role)
  AND ($3::text = '' OR u.name ILIKE '%' || $3 || '%' OR u.email ILIKE '%' || $3 || '%')
ORDER BY u.created_at DESC
LIMIT $4 OFFSET $5;

Pagination

Standard previous/next pagination with “Showing X-Y of Z” display. URL search params are updated on filter changes, with page reset to 1 when filters change.

API Endpoint

MethodPathAuthDescription
GET/v1/orgs/{orgId}/usersBearerAuthList org users with filters

Security

  • Tenant isolation — All queries scoped to org_id from JWT claims.
  • Read-only — This endpoint only lists users. User creation happens via the Org Onboarding setup wizard or the Entra directory import in the Members feature.

Key Files

FilePurpose
backend/db/queries/users.sqlListOrgUsers, CountOrgUsers, ListOrgUsersByProject
backend/api/internal/orguser/handler.goHTTP handler for user listing
backend/api/internal/orguser/service.goBusiness logic: filters, pagination
apps/web/src/actions/users.tsBFF server actions: listOrgUsers
apps/web/src/app/org-dashboard/[orgId]/users/page.tsxUsers page (RSC + Suspense)
apps/web/src/app/org-dashboard/[orgId]/users/_components/users-table.tsxUsers table with role filter, search, pagination