Loading…
/family is the team directory — the TeamMemberDocument records (name, role,
photo, bio, ordering, archive/employment flags) that feed the public
about/team surfaces. The listing page is a client component with search,
archive/employment/role filters, multi-select bulk actions, and drag-to-reorder
via framer-motion Reorder.
Access is HR-gated, not content-gated: the subtree
layout.tsx
redirects to / unless the caller holds org:sys:manage or
org:hrm:jobs_manage (checked with checkRole, not requirePermission).
| Route | Purpose | Guard |
|---|---|---|
/family | Listing — search, filters, bulk archive/restore/delete, reorder + save | org:sys:manage or org:hrm:jobs_manage (layout.tsx) |
/family/[id] | Member editor — details, photo upload, Clerk-user link/unlink | Same layout gate |
Shared UI lives in components/ImageUpload.tsx (photo upload widget).
| Method | Path | Guard | Purpose |
|---|---|---|---|
GET / POST | /api/admin/family | org:sys:manage or org:hrm:jobs_manage | List / create members |
GET / PATCH / DELETE | /api/admin/family/[id] | Same | Read / update / delete one member |
POST | /api/admin/family/reorder | Same | Persist drag-reordered sequence |
POST | /api/admin/family/bulk | Same | Bulk archive / restore / delete |
POST | /api/admin/family/upload | Same | Member photo upload |
POST | /api/admin/family/[id]/invite | Same | Invite / notify the member |
POST | /api/admin/family/[id]/sync | Same | Re-sync linked user data |
POST | /api/admin/family/migrate | Same | One-off data migration |
The editor also reads /api/admin/users (see System) to
attach a member record to a workspace login via
/api/admin/users/[id]/link-family.
org:hrm:* moduleorg:sys / org:hrm permissions