feat: tambah fitur impersonate user untuk super_admin

This commit is contained in:
2026-04-03 06:33:13 +07:00
parent 3a4e8a271c
commit 5d14b55173
7 changed files with 106 additions and 3 deletions
+10
View File
@@ -50,4 +50,14 @@ class User extends Authenticatable
{
return $this->hasMany(CashRecord::class, 'created_by');
}
public function canImpersonate(): bool
{
return $this->hasRole('super_admin');
}
public function canBeImpersonated(): bool
{
return ! $this->hasRole('super_admin');
}
}