Exponential 5.x Kernel 7.5.40 Exponential New Stack (Symfony-based) Kernel — PHP Class Reference

Public Member Functions | Private Member Functions | Private Attributes | List of all members
eZ\Publish\Core\Repository\Permission\PermissionResolver Class Reference

Core implementation of PermissionResolver interface. More...

Inheritance diagram for eZ\Publish\Core\Repository\Permission\PermissionResolver:

## Public Member Functions
| __construct (RoleDomainMapper $roleDomainMapper, LimitationService $limitationService, UserHandler $userHandler, APIUserReference $userReference, array $policyMap=[])
| getCurrentUserReference ()
| Get current user reference. More...
| setCurrentUserReference (APIUserReference $userReference)
| hasAccess ($module, $function, APIUserReference $userReference=null)
| sudo (callable $callback, RepositoryInterface $outerRepository)
Public Member Functions inherited from eZ\Publish\API\Repository\PermissionResolver
| setCurrentUserReference (UserReference $userReference)
| Sets the current user to the given $user. More...
| hasAccess ($module, $function, UserReference $userReference=null)
| Low level permission function: Returns boolean value, or an array of limitations that user permission depends on. More...
| canUser ($module, $function, ValueObject $object, array $targets=[])
| Indicates if the current user is allowed to perform an action given by the function on the given objects. More...
| lookupLimitations (string $module, string $function, ValueObject $object, array $targets=[], array $limitationsIdentifiers=[])
| {} More...

## Private Member Functions
| isGrantedByLimitation (Limitation $limitation, APIUserReference $currentUserReference, ValueObject $object, ?array $targets)
| isDeniedByRoleLimitation (?Limitation $limitation, APIUserReference $currentUserReference, ValueObject $object, ?array $targets)
| prepareTargetsForType (?array $targets, LimitationType $type)
| Prepare list of targets for the given Type keeping BC. More...

## Private Attributes
| $sudoNestingLevel = 0
| $roleDomainMapper
| $limitationService
| $userHandler
| $currentUserRef
| $policyMap

## Detailed Description

Core implementation of PermissionResolver interface.

Definition at line 28 of file Core/Repository/Permission/PermissionResolver.php.

## Constructor & Destructor Documentation

## ◆ __construct()

eZ\Publish\Core\Repository\Permission\PermissionResolver::__construct | ( | RoleDomainMapper | $roleDomainMapper,
|  | LimitationService | $limitationService,
|  | UserHandler | $userHandler,
|  | APIUserReference | $userReference,
|  | array | $policyMap = `[]`
| ) |  |

Parameters

  \eZ\Publish\Core\Repository\Helper\RoleDomainMapper | $roleDomainMapper |
  \eZ\Publish\Core\Repository\Helper\LimitationService | $limitationService |
  \eZ\Publish\SPI\Persistence\User\Handler | $userHandler |
  \eZ\Publish\API\Repository\Values\User\UserReference | $userReference |
  array | $policyMap | Map of system configured policies, for validation usage.

Definition at line 67 of file Core/Repository/Permission/PermissionResolver.php.

References eZ\Publish\Core\Repository\Permission\PermissionResolver\$limitationService, eZ\Publish\Core\Repository\Permission\PermissionResolver\$policyMap, eZ\Publish\Core\Repository\Permission\PermissionResolver\$roleDomainMapper, and eZ\Publish\Core\Repository\Permission\PermissionResolver\$userHandler.

## Member Function Documentation

## ◆ getCurrentUserReference()

eZ\Publish\Core\Repository\Permission\PermissionResolver::getCurrentUserReference | ( |  | ) |

Get current user reference.

Returns
  \eZ\Publish\API\Repository\Values\User\UserReference

Implements eZ\Publish\API\Repository\PermissionResolver.

Definition at line 81 of file Core/Repository/Permission/PermissionResolver.php.

References eZ\Publish\Core\Repository\Permission\PermissionResolver\$currentUserRef.

Referenced by eZ\Publish\Core\Repository\Permission\PermissionResolver\hasAccess().

## ◆ hasAccess()

eZ\Publish\Core\Repository\Permission\PermissionResolver::hasAccess | ( |  | $module,
|  |  | $function,
|  | APIUserReference | $userReference = `null`
| ) |  |

Definition at line 96 of file Core/Repository/Permission/PermissionResolver.php.

References eZ\Publish\Core\Repository\Permission\PermissionResolver\getCurrentUserReference().

## ◆ isDeniedByRoleLimitation()

eZ\Publish\Core\Repository\Permission\PermissionResolver::isDeniedByRoleLimitation | ( | ?Limitation | $limitation,
|  | APIUserReference | $currentUserReference,
|  | ValueObject | $object,
|  | ?array | $targets
| ) |  |
| private

Parameters

  \eZ\Publish\API\Repository\Values\User\Limitation | null | $limitation |
  \eZ\Publish\API\Repository\Values\User\UserReference | $currentUserReference |
  \eZ\Publish\API\Repository\Values\ValueObject | $object |
  array | null | $targets |

Returns
  bool

Exceptions

Definition at line 363 of file Core/Repository/Permission/PermissionResolver.php.

## ◆ isGrantedByLimitation()

eZ\Publish\Core\Repository\Permission\PermissionResolver::isGrantedByLimitation | ( | Limitation | $limitation,
|  | APIUserReference | $currentUserReference,
|  | ValueObject | $object,
|  | ?array | $targets
| ) |  |
| private

Parameters

  \eZ\Publish\API\Repository\Values\User\Limitation | $limitation |
  \eZ\Publish\API\Repository\Values\User\UserReference | $currentUserReference |
  \eZ\Publish\API\Repository\Values\ValueObject | $object |
  array | null | $targets |

Returns
  bool

Exceptions

Definition at line 335 of file Core/Repository/Permission/PermissionResolver.php.

## ◆ prepareTargetsForType()

eZ\Publish\Core\Repository\Permission\PermissionResolver::prepareTargetsForType | ( | ?array | $targets,
|  | LimitationType | $type
| ) |  |
| private

Prepare list of targets for the given Type keeping BC.

Parameters

  array | null | $targets |
  \eZ\Publish\SPI\Limitation\Type | $type |

Returns
  array|null

Definition at line 431 of file Core/Repository/Permission/PermissionResolver.php.

## ◆ setCurrentUserReference()

eZ\Publish\Core\Repository\Permission\PermissionResolver::setCurrentUserReference | ( | APIUserReference | $userReference | ) |

Definition at line 86 of file Core/Repository/Permission/PermissionResolver.php.

## ◆ sudo()

eZ\Publish\Core\Repository\Permission\PermissionResolver::sudo | ( | callable | $callback,
|  | RepositoryInterface | $outerRepository
| ) |  |

For internal use only, do not depend on this method.

Allows API execution to be performed with full access sand-boxed.

The closure sandbox will do a catch all on exceptions and rethrow after re-setting the sudo flag.

Example use: $location = $repository->sudo( function ( Repository $repo ) use ( $locationId ) { return $repo->getLocationService()->loadLocation( $locationId ) } );

Parameters

  \Closure | $callback |
  \eZ\Publish\API\Repository\Repository | $outerRepository |

Exceptions

Definition at line 408 of file Core/Repository/Permission/PermissionResolver.php.

## Member Data Documentation

## ◆ $currentUserRef

eZ\Publish\Core\Repository\Permission\PermissionResolver::$currentUserRef
| private

Definition at line 51 of file Core/Repository/Permission/PermissionResolver.php.

Referenced by eZ\Publish\Core\Repository\Permission\PermissionResolver\getCurrentUserReference().

## ◆ $limitationService

eZ\Publish\Core\Repository\Permission\PermissionResolver::$limitationService
| private

Definition at line 41 of file Core/Repository/Permission/PermissionResolver.php.

Referenced by eZ\Publish\Core\Repository\Permission\PermissionResolver\__construct().

## ◆ $policyMap

eZ\Publish\Core\Repository\Permission\PermissionResolver::$policyMap
| private

Definition at line 58 of file Core/Repository/Permission/PermissionResolver.php.

Referenced by eZ\Publish\Core\Repository\Permission\PermissionResolver\__construct().

## ◆ $roleDomainMapper

eZ\Publish\Core\Repository\Permission\PermissionResolver::$roleDomainMapper
| private

Definition at line 38 of file Core/Repository/Permission/PermissionResolver.php.

Referenced by eZ\Publish\Core\Repository\Permission\PermissionResolver\__construct().

## ◆ $sudoNestingLevel

eZ\Publish\Core\Repository\Permission\PermissionResolver::$sudoNestingLevel = 0
| private

Definition at line 35 of file Core/Repository/Permission/PermissionResolver.php.

## ◆ $userHandler

eZ\Publish\Core\Repository\Permission\PermissionResolver::$userHandler
| private

Definition at line 44 of file Core/Repository/Permission/PermissionResolver.php.

Referenced by eZ\Publish\Core\Repository\Permission\PermissionResolver\__construct().

The documentation for this class was generated from the following file:

- Core/Repository/Permission/PermissionResolver.php

Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.