protected function CourseAccessControlHandler::checkAccess in Course 8.2
Same name and namespace in other branches
- 8.3 src/Access/CourseAccessControlHandler.php \Drupal\course\Access\CourseAccessControlHandler::checkAccess()
- 3.x src/Access/CourseAccessControlHandler.php \Drupal\course\Access\CourseAccessControlHandler::checkAccess()
Link the activities to the permissions. checkAccess is called with the $operation as defined in the routing.yml file.
Overrides EntityAccessControlHandlerBase::checkAccess
File
- src/
Access/ CourseAccessControlHandler.php, line 24
Class
- CourseAccessControlHandler
- Access controller for the Course entity.
Namespace
Drupal\course\AccessCode
protected function checkAccess(EntityInterface $entity, $operation, AccountInterface $account) {
if ($operation == 'edit') {
return AccessResult::allowedIfHasPermission($account, 'administer course');
}
else {
return parent::checkAccess($entity, $operation, $account);
}
}