You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Receipt-settings startup race and role-based printing permissions #1225
Follow-up to PR #1202 / Issue #1188 (Frontend browser-print receipt settings remain stale until Settings page is opened).
Problem
Startup Race: Browser printing reads usePosSettingsStore.getState() synchronously. When an order is completed or printed immediately upon app startup or navigation before useReceiptSettingsSync has completed its asynchronous GET /settings/business request, printing renders default/stale merchant information.
Role-Based Printing Permissions: Under FloCafe's authorization model, staff roles who generate and print receipts (such as cashier or a server with payment/bill permissions) have bills.read, bills.generate, and payments.take, but are not granted general settings administrative privileges (settings.view or settings.manage). Currently, GET /settings/business requires requirePermission('settings.view'), and useReceiptSettingsSync guards execution with if (!tenantCan(currentTenant, 'settings.view')) return;. Consequently, non-admin staff who are authorized to print receipts are locked out of reading storefront receipt settings, resulting in customer receipts lacking store address, phone, logo, or tax registration details.
Acceptance Criteria
Allow roles authorized to print or read bills (settings.view, bills.read, bills.print, orders.read, bills.generate) to read storefront business receipt settings (GET /settings/business) without granting general settings administrative privileges (settings.manage or broad access to other settings).
Update useReceiptSettingsSync and usePrinter to ensure receipt settings are loaded before printing occurs, with safe fallback to existing/default settings if offline or unavailable.
Activity
fix(auth): return required permission in requireAnyPermission 403 and…
fix: prevent receipt-settings startup race and allow bill roles to re…
khaira777 commentedon Oct 20, 2026
Verified and delivered on
mainvia PR #1226 (a7d410d5c52d7af753d1f964040165472f20ecb8).