feat(badges): allow public_access to print first-print badges
Badge print kiosks authenticate at the public_access level (site-wide passcode). Previously the print gate was trusted_access, meaning kiosk operators had to sign in at the trusted level just to print. Changed in both the list view and the badge detail controls panel: - First print: public_access and above (kiosk use case) - Reprint: still requires trusted_access + edit_mode ae_comp__badge_obj_li.svelte: added is_public derived; updated can_print and the print button #if condition. ae_comp__badge_print_controls.svelte: added is_public derived; updated can_print comment and logic. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -99,6 +99,9 @@ let {
|
||||
// trusted_access is true for Trusted and every level above it (Administrator,
|
||||
// Manager, Super). No need to OR in administrator_access — it's already covered.
|
||||
let is_trusted = $derived($ae_loc.trusted_access === true);
|
||||
// public_access — site-wide passcode or higher. Badge print kiosks run at this level.
|
||||
// Sufficient for first-print only; reprints require trusted + edit_mode.
|
||||
let is_public = $derived($ae_loc.public_access === true);
|
||||
// Minimum bar to edit any field. Anonymous/public users see values but cannot edit.
|
||||
let is_auth = $derived($ae_loc.authenticated_access === true);
|
||||
|
||||
@@ -200,8 +203,9 @@ function toggle_section(which: 'attendee' | 'staff') {
|
||||
let print_count = $derived($lq__event_badge_obj?.print_count ?? 0);
|
||||
let is_printed = $derived(print_count >= 1);
|
||||
|
||||
// Print is available to Trusted+ when: not yet printed, OR global edit mode is on (reprint).
|
||||
let can_print = $derived(is_trusted && (!is_printed || is_global_edit_mode));
|
||||
// Print is available to Public+ for first prints (kiosk use case).
|
||||
// Reprints require Trusted + global edit mode.
|
||||
let can_print = $derived((is_public && !is_printed) || (is_trusted && is_global_edit_mode));
|
||||
|
||||
type PrintStatus = 'idle' | 'loading' | 'done' | 'error';
|
||||
let print_status: PrintStatus = $state('idle');
|
||||
|
||||
Reference in New Issue
Block a user