Class

eZ\Publish\Core\Limitation\BlockingLimitationType

class BlockingLimitationType implements Type

BlockingLimitationType is a limitation type that always says no to the permission system.

It is for use in cases where a limitation is not implemented, or limitation is legacy specific and it is then not possible to know when to say yes, so we need to say no.

Methods

__construct(string $identifier)

Create new Blocking Limitation with identifier injected dynamically.

acceptValue(Limitation $limitationValue)

Accepts a Blocking Limitation value and checks for structural validity.

ValidationError[] validate(Limitation $limitationValue)

Makes sure LimitationValue->limitationValues is valid according to valueSchema().

Limitation buildValue(array $limitationValues)

Create the Limitation Value.

bool evaluate(Limitation $value, UserReference $currentUser, ValueObject $object, array $targets = null)

Evaluate permission against content & target(placement/parent/assignment).

CriterionInterface getCriterion(Limitation $value, UserReference $currentUser)

Returns Criterion for use in find() query.

mixed[]|int valueSchema()

Returns info on valid $limitationValues.

Details

at line 42
public __construct(string $identifier)

Create new Blocking Limitation with identifier injected dynamically.

Parameters

string $identifier The identifier of the limitation

Exceptions

InvalidArgumentException If $identifier is empty

at line 60
public acceptValue(Limitation $limitationValue)

Accepts a Blocking Limitation value and checks for structural validity.

Makes sure LimitationValue object and ->limitationValues is of correct type.

Parameters

Limitation $limitationValue

Exceptions

InvalidArgumentException If the value does not match the expected type/structure

at line 78
public ValidationError[] validate(Limitation $limitationValue)

Makes sure LimitationValue->limitationValues is valid according to valueSchema().

Make sure {@link acceptValue()} is checked first!

Parameters

Limitation $limitationValue

Return Value

ValidationError[]

at line 101
public Limitation buildValue(array $limitationValues)

Create the Limitation Value.

Parameters

array $limitationValues

Return Value

Limitation

at line 121
public bool evaluate(Limitation $value, UserReference $currentUser, ValueObject $object, array $targets = null)

Evaluate permission against content & target(placement/parent/assignment).

Parameters

Limitation $value
UserReference $currentUser
ValueObject $object
array $targets The context of the $object, like Location of Content, if null none where provided by caller

Return Value

bool Returns one of ACCESS_* constants

Exceptions

InvalidArgumentException If any of the arguments are invalid Example: If LimitationValue is instance of ContentTypeLimitationValue, and Type is SectionLimitationType.
BadStateException If value of the LimitationValue is unsupported Example if OwnerLimitationValue->limitationValues[0] is not one of: [ 1, 2 ]

at line 138
public CriterionInterface getCriterion(Limitation $value, UserReference $currentUser)

Returns Criterion for use in find() query.

Parameters

Limitation $value
UserReference $currentUser

Return Value

CriterionInterface

at line 151
public mixed[]|int valueSchema()

Returns info on valid $limitationValues.

Return Value

mixed[]|int In case of array, a hash with key as valid limitations value and value as human readable name of that option, in case of int on of VALUESCHEMA constants.

Exceptions

NotImplementedException Values will need to be injected in ctor.