12-05-2026 Frontend dev
This commit is contained in:
parent
405df0a122
commit
5b8bdf4182
779 changed files with 480564 additions and 6241 deletions
19
app/Services/Auth/UserRolePermissionSyncService.php
Normal file
19
app/Services/Auth/UserRolePermissionSyncService.php
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
<?php
|
||||
|
||||
namespace App\Services\Auth;
|
||||
|
||||
use App\Models\User;
|
||||
|
||||
/**
|
||||
* Zentraler Service für Rollen-Zuweisung an User.
|
||||
*
|
||||
* Rollen-Checks laufen ausschließlich über Spatie-Rollen (nicht über direkte Permissions).
|
||||
* Dieser Service ist der Single Point of Truth für Rollen-Sync im Seeder und beim Legacy-Import.
|
||||
*/
|
||||
class UserRolePermissionSyncService
|
||||
{
|
||||
public function assignRoleAndSyncPermissions(User $user, string $role): void
|
||||
{
|
||||
$user->syncRoles([$role]);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue