You are here

public function OpignoModuleManagerController::ajaxCheckedActivitiesAccess in Opigno module 3.x

Same name and namespace in other branches
  1. 8 src/Controller/OpignoModuleManagerController.php \Drupal\opigno_module\Controller\OpignoModuleManagerController::ajaxCheckedActivitiesAccess()

Check access.

1 string reference to 'OpignoModuleManagerController::ajaxCheckedActivitiesAccess'
opigno_module.routing.yml in ./opigno_module.routing.yml
opigno_module.routing.yml

File

src/Controller/OpignoModuleManagerController.php, line 154

Class

OpignoModuleManagerController
Controller for all the actions of the Opigno module manager.

Namespace

Drupal\opigno_module\Controller

Code

public function ajaxCheckedActivitiesAccess() {
  $account = $this
    ->currentUser();
  $is_content_manager = LearningPathAccess::memberHasRole('content_manager', $account);
  if ($is_content_manager > 0 || $account
    ->hasPermission('administer module entities')) {
    return AccessResult::allowed();
  }
  else {
    return AccessResult::forbidden();
  }
}