Allow site admins into ticketing settings

This commit is contained in:
Joel Wedemire
2026-04-08 21:56:17 -07:00
parent 5ffb9f1eed
commit 4f65724f90

View File

@@ -39,13 +39,14 @@ class TicketingSettingsController extends Controller
*/ */
private function requireAgentAccess(): void private function requireAgentAccess(): void
{ {
// Site admins always have access
if ($this->isSiteAdmin()) {
return;
}
$hasAccess = TicketingAgentAccess::where('user_id', Auth::id())->exists(); $hasAccess = TicketingAgentAccess::where('user_id', Auth::id())->exists();
if (!$hasAccess) { if (!$hasAccess) {
// Allow site admins through during bootstrap (no groups yet)
if ($this->isBootstrapState() && $this->isSiteAdmin()) {
return;
}
abort(403, 'You need agent access to manage ticketing settings.'); abort(403, 'You need agent access to manage ticketing settings.');
} }
} }