- Per-user admin mode (simple: bookings/contracts, blocked periods, guests, portal tasks, reviews; expert: everything the role allows), user menu switch, FollowsAdminMode on all resources/pages (guarded by a test); roles keep deciding permissions. - Users list shows mode and 2FA; admins can reset another user's 2FA. - New "Sperrzeiten" list for all apartments (manual blocks editable, portal blocks read-only). - styles/final: clean hand-built SVG mark, logo, favicon (dark-mode aware), 4 icons, wave divider, plus PNG/WebP for mail/PDF/touch icon; colours via --brand-* variables. - Decisions recorded in KONZEPT §6a/6b (booking path 1 via offer + guest acceptance, direct booking later; tourist tax by Ferienservice Balu); agent documents added and marked as analysis with assumptions; styles excluded from the deploy package. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
23 lines
603 B
PHP
23 lines
603 B
PHP
<?php
|
|
|
|
namespace App\Filament\Concerns;
|
|
|
|
use App\Enums\AdminMode;
|
|
use App\Models\User;
|
|
use Filament\Facades\Filament;
|
|
|
|
/**
|
|
* Hides the menu entry in the simple admin mode unless it is part of AdminMode::SIMPLE_NAVIGATION.
|
|
* The page stays reachable by URL; access is governed by the policies.
|
|
*/
|
|
trait FollowsAdminMode
|
|
{
|
|
public static function shouldRegisterNavigation(): bool
|
|
{
|
|
$user = Filament::auth()->user();
|
|
$mode = $user instanceof User ? $user->adminMode() : AdminMode::Expert;
|
|
|
|
return parent::shouldRegisterNavigation() && $mode->shows(static::class);
|
|
}
|
|
}
|