You are here

function CourseController::completionAccess in Course 8.3

Same name and namespace in other branches
  1. 8.2 src/Controller/CourseController.php \Drupal\course\Controller\CourseController::completionAccess()
  2. 3.x src/Controller/CourseController.php \Drupal\course\Controller\CourseController::completionAccess()

Access callback for completion page.

1 string reference to 'CourseController::completionAccess'
course.routing.yml in ./course.routing.yml
course.routing.yml

File

src/Controller/CourseController.php, line 18

Class

CourseController

Namespace

Drupal\course\Controller

Code

function completionAccess(Course $course) {
  $account = \Drupal::currentUser();
  return Drupal\Core\Access\AccessResult::allowedIf($course
    ->isEnrolled($account));
}