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

PermissionsCriterionHandler.php
Go to the documentation of this file.
1 <?php
2
7 namespace eZ\Publish\Core\Repository;
8
9 use eZ\Publish\API\Repository\Values\Content\Query\Criterion;
10 use eZ\Publish\API\Repository\Values\Content\Query\Criterion\LogicalAnd;
11 use eZ\Publish\Core\Repository\Permission\PermissionCriterionResolver;
12
18 class PermissionsCriterionHandler extends PermissionCriterionResolver
19 {
29 public function addPermissionsCriterion(Criterion &$criterion)
30 {
31 $permissionCriterion = $this->getPermissionsCriterion();
32 if ($permissionCriterion === true || $permissionCriterion === false) {
33 return $permissionCriterion;
34 }
35
36 // Merge with original $criterion
37 if ($criterion instanceof LogicalAnd) {
38 $criterion->criteria[] = $permissionCriterion;
39 } else {
40 $criterion = new LogicalAnd(
41 [
42 $criterion,
43 $permissionCriterion,
44 ]
45 );
46 }
47
48 return true;
49 }
50 }
eZ\Publish\API\Repository\Values\Content\Query\Criterion\LogicalAnd
This criterion implements a logical AND criterion and will only match if ALL of the given criteria ma...
Definition: API/Repository/Values/Content/Query/Criterion/LogicalAnd.php:14
eZ\Publish\API\Repository\Values\Content\Query\Criterion
Definition: API/Repository/Values/Content/Query/Criterion.php:15
eZ\Publish\Core\Repository\Permission\PermissionCriterionResolver
Implementation of Permissions Criterion Resolver.
Definition: Core/Repository/Permission/PermissionCriterionResolver.php:24
eZ\Publish\Core\Repository\PermissionsCriterionHandler
Handler for permissions Criterion.
Definition: PermissionsCriterionHandler.php:19
eZ\Publish\Core\Repository\PermissionsCriterionHandler\addPermissionsCriterion
addPermissionsCriterion(Criterion &$criterion)
Adds content, read Permission criteria if needed and return false if no access at all.
Definition: PermissionsCriterionHandler.php:29
eZ\Publish\API\Repository\PermissionCriterionResolver
This service provides methods for resolving criterion permissions.
Definition: API/Repository/PermissionCriterionResolver.php:15
eZ\Publish\API\Repository\PermissionCriterionResolver\getPermissionsCriterion
getPermissionsCriterion($module, $function, ?array $targets=null)
Get criteria representation for a permission.
Definition: Core/Repository/Permission/PermissionCriterionResolver.php:57
eZ\Publish\API\Repository\Values\Content\Query\Criterion
Definition: API/Repository/Values/Content/Query/Criterion/Ancestor.php:7
eZ\Publish\Core\Repository
Definition: Core/Repository/BookmarkService.php:9
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.