feat: tambah fitur impersonate user untuk super_admin
This commit is contained in:
@@ -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');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user