Some checks failed
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 1m56s
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 1m56s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 2m2s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 2m9s
CI / PHP 8.3 / mysql:8.0 (pull_request) Failing after 2m40s
CI / PHP 8.4 / mysql:8.0 (pull_request) Failing after 2m35s
CI / PHP 8.4 / mysql:8.4 (pull_request) Failing after 2m29s
CI / PHP 8.3 / mysql:8.4 (pull_request) Failing after 2m38s
CI / Build-Artefakte aktuell (pull_request) Successful in 55s
- Seiten-Plugin: Seitenbaum mit Adressen, Seitennavigation, Brotkrumen und optional Hauptnavigation; Sichtbarkeit vererbt sich auf Unterseiten - Pagebuilder (Block-Registry im Kern, Plugins tragen Blöcke bei): Abschnitt, Spalten, Tabs, Akkordeon, Box, Überschrift, Text (TipTap), Zitat, Schaltflächen, Symbolliste, Tabelle, Trennlinie, Abstand, Bild, Galerie, Video (erst nach Klick), Titelbild, Ansprechpartner, Downloads, Unterseiten, Neuigkeiten, Termine; Sichtbarkeit je Block; Bereinigung beim Speichern - Editor im Portal: Ziehen und Ablegen, Autospeichern als Entwurf, Rückgängig, Gerätevorschau, Versionen, Zeitsteuerung, Bearbeitungssperre, Freigabe anfordern - Rechte „inkl. Unterseiten“ werden im Rechte-Cache aufgelöst - Neuigkeiten: Schreiben im Portal, Freigabe-Workflow mit Benachrichtigungen - Bereich „Redaktion“, Benachrichtigungen im Portal - storage/.migrations-fingerprint nicht mehr ausliefern Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
88 lines
3.3 KiB
PHP
88 lines
3.3 KiB
PHP
<?php
|
||
|
||
namespace App\Providers;
|
||
|
||
use App\Dashboard\CoreWidgets;
|
||
use App\Dashboard\Widgets;
|
||
use App\Editorial\Editorial;
|
||
use App\Models\User;
|
||
use App\Pagebuilder\Blocks;
|
||
use App\Support\Abilities;
|
||
use App\Support\Avatars;
|
||
use App\Support\BackgroundTasks;
|
||
use App\Support\Branding;
|
||
use App\Support\Installation;
|
||
use App\Support\License\LicenseStore;
|
||
use App\Support\Navigation;
|
||
use App\Support\Permissions\PermissionResource;
|
||
use App\Support\Permissions\Permissions;
|
||
use App\Support\ProfileFields;
|
||
use App\Support\QuickLinks;
|
||
use App\Support\Settings;
|
||
use App\Support\Update\InstalledVersion;
|
||
use App\Support\Update\MaintenanceFlag;
|
||
use App\Support\Update\UpdateProgress;
|
||
use Illuminate\Database\Eloquent\Model;
|
||
use Illuminate\Support\Facades\Gate;
|
||
use Illuminate\Support\ServiceProvider;
|
||
use Illuminate\Validation\Rules\Password;
|
||
|
||
class AppServiceProvider extends ServiceProvider
|
||
{
|
||
public function register(): void
|
||
{
|
||
// Frisch hochgeladen: .env und Schlüssel anlegen; bis zur Einrichtung ohne Datenbank
|
||
// für Sitzungen, Cache und Queue auskommen (der Web-Installer braucht das).
|
||
if (! $this->app->runningUnitTests()) {
|
||
Installation::prepareEnvironment();
|
||
}
|
||
|
||
if (! Installation::isInstalled()) {
|
||
config(['session.driver' => 'file', 'cache.default' => 'file', 'queue.default' => 'sync']);
|
||
}
|
||
|
||
$this->app->singleton(Settings::class);
|
||
$this->app->singleton(Branding::class);
|
||
$this->app->singleton(Avatars::class);
|
||
$this->app->singleton(QuickLinks::class);
|
||
$this->app->singleton(LicenseStore::class);
|
||
$this->app->singleton(Permissions::class);
|
||
$this->app->singleton(ProfileFields::class);
|
||
$this->app->singleton(Blocks::class);
|
||
$this->app->singleton(Editorial::class);
|
||
$this->app->singleton(BackgroundTasks::class);
|
||
$this->app->singleton(InstalledVersion::class);
|
||
$this->app->singleton(UpdateProgress::class);
|
||
$this->app->singleton(MaintenanceFlag::class);
|
||
}
|
||
|
||
public function boot(): void
|
||
{
|
||
CoreWidgets::register($this->app->make(Widgets::class));
|
||
|
||
$this->app->make(Navigation::class)->add('editorial', 'Redaktion', '/redaktion', active: ['editorial', 'pages.editor', 'news.editor.*'], sort: 85,
|
||
visible: fn (User $user) => $this->app->make(Editorial::class)->visibleFor($user));
|
||
|
||
// N+1-Abfragen in Entwicklung und Tests sofort sichtbar machen (docs/PLAN.md, Performance).
|
||
Model::preventLazyLoading(! $this->app->isProduction());
|
||
|
||
// Rechte aus Rollen (App\Support\Abilities) entscheidet das Rechtesystem – Administration
|
||
// hat sie alle. Alles andere (z. B. „delete“ auf einem Modell) entscheiden die Policies,
|
||
// damit Regeln wie „Systemrollen nie löschen“ auch für Administratoren gelten.
|
||
Gate::before(function (User $user, string $ability, array $arguments) {
|
||
if (! $user->is_active) {
|
||
return false;
|
||
}
|
||
|
||
if (! $this->app->make(Abilities::class)->exists($ability)) {
|
||
return null;
|
||
}
|
||
|
||
[$type, $id] = PermissionResource::from($arguments);
|
||
|
||
return $user->permissions()->can($ability, $type, $id);
|
||
});
|
||
|
||
Password::defaults(fn () => Password::min(10)->letters()->numbers());
|
||
}
|
||
}
|