Access control handler for the job item entity.
Expanded class hierarchy of JobItemAccessControlHandler
class JobItemAccessControlHandler extends JobAccessControlHandler {
/**
* {@inheritdoc}
*/
protected function checkAccess(EntityInterface $entity, $operation, AccountInterface $account) {
if ($operation === 'delete') {
return AccessResult::allowedIf($entity
->isInactive());
}
else {
if ($operation == 'abort') {
return AccessResult::allowedIf($entity
->isActive() || $entity
->isNeedsReview());
}
else {
if ($entity
->getJob()) {
return $entity
->getJob()
->access($operation, $account, TRUE);
}
}
}
}
}
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
JobAccessControlHandler:: |
protected | function | ||
JobItemAccessControlHandler:: |
protected | function |
Overrides JobAccessControlHandler:: |