for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace Uxmp\Core\Component\User;
use Uxmp\Core\Api\Lib\Enum\AclEnum;
use Uxmp\Core\Orm\Model\UserInterface;
/**
* Checks for specific user privileges
*/
final class PrivilegeChecker implements PrivilegeCheckerInterface
{
* Returns `true` if the user is an admin user
public function isAdmin(UserInterface $user): bool
return in_array(
AclEnum::USER_EDIT->value,
$this->getAcl($user),
true,
);
}
* Returns user's acl
*
* @return array<int>
public function getAcl(
UserInterface $user,
): array {
return [
];