notification-roles.ts 542 B

123456789101112
  1. /**
  2. * Who the workshop's notification feed is for.
  3. *
  4. * Every member may open the live socket (that is how a work order stays
  5. * current for whoever has it open), but the notification feed is the
  6. * workshop's own inbox: payments, messages, what an admin acts on. The
  7. * action that reads it and the socket that pushes it have to agree, so the
  8. * rule lives here and both import it.
  9. */
  10. export function readsNotifications(role: string | null | undefined): boolean {
  11. return role === 'owner' || role === 'admin' || role === 'super_admin'
  12. }