feat: consolidar desenvolvimentos do portal InvestMoz

This commit is contained in:
2026-11-03 23:32:32 +02:00
parent 1da273f1f3
commit 36c8cadb49
345 changed files with 110714 additions and 2799 deletions
+21
View File
@@ -0,0 +1,21 @@
<?php
namespace App\Services;
use App\Models\User;
/** Existing internal administration; does not establish an institutional mandate. */
final class EducationAccess
{
public function allows(User $actor): bool
{
return $actor->hasVerifiedEmail() && ! app(PortalProfileAccess::class)->has($actor, 'auditor')
&& ($actor->can('manage-portal') || app(ScopedPortalAdministration::class)->administrative($actor));
}
public function authorize(User $actor): void
{
abort_unless(config('education.enabled'), 404);
abort_unless($this->allows($actor), 403);
}
}