Skip to content

๐Ÿ‘ฅ Staff Management โ€‹

KitchenAsty includes a complete staff management system with role-based access control, email invitations, and admin UI filtering.

Admin Staff Management

๐ŸŽญ Roles โ€‹

Staff accounts have one of three roles:

RoleDescription
SUPER_ADMIN๐Ÿ‘‘ Full access to everything, including staff management
MANAGER๐Ÿข Access to all operational and configuration pages, but not staff management
STAFF๐Ÿ‘ค Access to day-to-day operational pages only

๐Ÿ“„ Page Visibility by Role โ€‹

PageSuper AdminManagerStaff
๐Ÿ“Š Dashboardโœ“โœ“โœ“
๐Ÿ“ฆ Ordersโœ“โœ“โœ“
๐Ÿช‘ Reservationsโœ“โœ“โœ“
โญ Reviewsโœ“โœ“โœ“
๐Ÿณ Kitchenโœ“โœ“โœ“
๐Ÿ“ Locationsโœ“โœ“
๐Ÿฝ๏ธ Menuโœ“โœ“
๐Ÿท๏ธ Couponsโœ“โœ“
โšก Automationโœ“โœ“
๐ŸŽ Loyaltyโœ“โœ“
๐ŸŽจ Designโœ“โœ“
๐Ÿ“œ Legalโœ“โœ“
๐Ÿ‘ฅ Staffโœ“

๐Ÿ“จ Invite Flow โ€‹

Super Admins can invite new staff members by email:

  1. ๐Ÿ–ฅ๏ธ Navigate to Staff > Invite Staff in the admin panel
  2. โœ๏ธ Enter the invitee's email, optional name, and desired role
  3. ๐Ÿ”‘ The system creates a secure single-use invite token (32-byte hex, 7-day expiry) and sends an email
  4. ๐Ÿ”— The invitee clicks the link, sets their name and password, and their account is created
  5. โœ… The invite token is marked as used and cannot be reused

Invite tokens are:

  • ๐Ÿ”’ Single-use โ€” marked with usedAt timestamp on acceptance
  • โ™ป๏ธ Revocable โ€” stored in the database as queryable records
  • โฐ Time-limited โ€” expire after 7 days

๐Ÿ“‹ Staff List โ€‹

The staff list page (Super Admin only) provides:

  • ๐Ÿ” Search by name or email
  • ๐ŸŽญ Filter by role (Super Admin, Manager, Staff)
  • ๐Ÿ“„ Pagination with configurable page size
  • ๐Ÿ”€ Toggle active/inactive status directly from the list
  • โœ๏ธ Edit link to update staff details

โœ๏ธ Edit Staff โ€‹

Super Admins can update:

  • ๐Ÿ“› Name
  • ๐ŸŽญ Role (cannot change your own role)
  • ๐Ÿ“ฑ Phone number
  • ๐Ÿ“ Assigned location (dropdown)
  • ๐Ÿ”€ Active/inactive status (cannot deactivate yourself)

๐Ÿ–ฅ๏ธ Admin UI โ€‹

The admin panel adapts based on the logged-in user's role:

  • ๐Ÿงญ Navigation โ€” only shows links the user has permission to access
  • ๐Ÿ›ก๏ธ Route guards โ€” RequireRole component redirects unauthorized users to the dashboard
  • ๐Ÿ‘ค User info โ€” sidebar displays the user's name and role badge
  • ๐Ÿ” Header โ€” shows user name and logout button

๐Ÿ” API Protection โ€‹

All staff endpoints are protected with middleware:

  • ๐Ÿ”‘ authenticate โ€” requires valid JWT
  • ๐Ÿšซ requireStaff โ€” rejects customer tokens
  • ๐ŸŽญ requireRole(...) โ€” checks the user's role against the allowed list

See the Staff API reference for endpoint details.