refactor(kernel): unify HTTP and CLI application lifecycle
Signed-off-by: Sebastian Krupinski <krupinski01@gmail.com>
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
namespace KTXC\Security\Authorization;
|
||||
|
||||
use KTXC\SessionIdentity;
|
||||
use KTXC\Context\IdentityContextInterface;
|
||||
|
||||
/**
|
||||
* Permission Checker
|
||||
@@ -11,7 +11,7 @@ use KTXC\SessionIdentity;
|
||||
class PermissionChecker
|
||||
{
|
||||
public function __construct(
|
||||
private readonly SessionIdentity $sessionIdentity
|
||||
private readonly IdentityContextInterface $identityContext
|
||||
) {}
|
||||
|
||||
/**
|
||||
@@ -24,7 +24,7 @@ class PermissionChecker
|
||||
*/
|
||||
public function can(string $permission, mixed $resource = null): bool
|
||||
{
|
||||
$identity = $this->sessionIdentity->identity();
|
||||
$identity = $this->identityContext->identity();
|
||||
|
||||
if (!$identity) {
|
||||
return false;
|
||||
@@ -113,7 +113,7 @@ class PermissionChecker
|
||||
*/
|
||||
public function getUserPermissions(): array
|
||||
{
|
||||
$identity = $this->sessionIdentity->identity();
|
||||
$identity = $this->identityContext->identity();
|
||||
|
||||
if (!$identity) {
|
||||
return [];
|
||||
|
||||
Reference in New Issue
Block a user