Represents Limitation type.
Indicates that Limitation Type implementation properly supports $targets passed as instances of Target.
Tags
Constants¶
ACCESS_ABSTAIN ¶
|
|
ACCESS_DENIED ¶
|
|
ACCESS_GRANTED ¶
Constants for return value of {@see evaluate()}.
|
|
Currently ACCESS_ABSTAIN must mean that evaluate does not support the provided $object or $targets, this is currently only supported by role limitations as policy limitations should not allow this.
Note: In future version constant values might change to 1, 0 and -1 as used in Symfony.
VALUE_SCHEMA_LOCATION_ID ¶
Constants for valueSchema() return values.
|
|
Used in cases where a certain value is accepted but the options are to many to return as a hash of options. GUI should typically present option to browse content tree to select limitation value(s).
VALUE_SCHEMA_LOCATION_PATH ¶
|
|
Methods¶
acceptValue() ¶
Accepts a Limitation value and checks for structural validity.
|
|
Makes sure LimitationValue object and ->limitationValues is of correct type.
Parameters
Name | Type | Default value | Description |
---|---|---|---|
$limitationValue | Limitation | - | - |
Tags
buildValue() ¶
Create the Limitation Value.
|
|
The is the method to create values as Limitation type needs value knowledge anyway in acceptValue, the reverse relation is provided by means of identifier lookup (Value has identifier, and so does RoleService).
Parameters
Name | Type | Default value | Description |
---|---|---|---|
$limitationValues | array<string|int, mixed> | - | - |
Return values
evaluate() ¶
Evaluate ("Vote") against a main value object and targets for the context.
|
|
Parameters
Name | Type | Default value | Description |
---|---|---|---|
$value | Limitation | - | - |
$currentUser | UserReference | - | - |
$object | ValueObject | - | - |
$targets | array<string|int, Target>|null | null |
An array of location, parent or "assignment" objects, if null: none where provided by caller |
Return values
bool|null
Returns one of ACCESS_* constants
Tags
getCriterion() ¶
Returns Criterion for use in find() query.
|
|
Parameters
Name | Type | Default value | Description |
---|---|---|---|
$value | Limitation | - | - |
$currentUser | UserReference | - | - |
Return values
CriterionInterface|LogicalOperator
Tags
validate() ¶
Makes sure LimitationValue->limitationValues is valid according to valueSchema().
|
|
Make sure Type::acceptValue() is checked first.
Parameters
Name | Type | Default value | Description |
---|---|---|---|
$limitationValue | Limitation | - | - |
Return values
array<string|int, ValidationError>
valueSchema() ¶
Returns info on valid $limitationValues.
|
|
Return values
array<string|int, 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 VALUE_SCHEMA_* constants. Note: The hash might be an instance of Traversable, and not a native php array.