refactor: fix BelongsToTenant trait to exempt candidates globally - removes all withoutGlobalScopes() workarounds

This commit is contained in:
jeremy bayse
2026-04-14 19:38:42 +02:00
parent 49ee91c601
commit e93a17f324
3 changed files with 11 additions and 29 deletions

View File

@@ -13,8 +13,14 @@ trait BelongsToTenant
if (Auth::check()) {
$user = Auth::user();
// Super admins see everything
if ($user->role === 'super_admin') {
// Super admins see everything
return;
}
// Candidates don't have a tenant_id but must access
// quizzes/job positions linked to their position
if ($user->role === 'candidate') {
return;
}