Initial commit

This commit is contained in:
2026-01-25 21:03:33 +01:00
commit 8d8e213f1c
2570 changed files with 479666 additions and 0 deletions
+24
View File
@@ -0,0 +1,24 @@
<?php
namespace Vanguard\Support;
trait CanImpersonateUsers
{
/**
* Check if a user can impersonate other users.
*/
public function canImpersonate(): bool
{
return $this->hasPermission('users.manage');
}
/**
* Check if a target user can be impersonated.
* By default, all users can be impersonated if a currently logged
* user is not already impersonating another user.
*/
public function canBeImpersonated(): bool
{
return ! app('impersonate')->isImpersonating();
}
}