users and institutions route, tests fixed

This commit is contained in:
Giuseppe Naponiello
2026-06-23 12:29:02 +02:00
parent fe73662903
commit 032f6a08df
23 changed files with 346 additions and 287 deletions

View File

@@ -38,20 +38,4 @@ class UserRole extends Model implements Auditable
{
return $this->hasMany(User::class, 'role_id');
}
/**
* Ruolo predefinito di sistema: non eliminabile.
*/
public function isSystemRole(): bool
{
return in_array($this->name, [self::ADMIN, self::SUPERVISOR, self::USER, self::GUEST], true);
}
/**
* Il ruolo è assegnato ad almeno un utente.
*/
public function isInUse(): bool
{
return $this->users()->exists();
}
}