You are here

public function ModalPageHelperService::verifyIfModalIsAvailableForEveryone in Modal 4.1.x

Same name and namespace in other branches
  1. 4.0.x src/Service/ModalPageHelperService.php \Drupal\modal_page\Service\ModalPageHelperService::verifyIfModalIsAvailableForEveryone()

Method to verify if Modal is available for everyone.

1 call to ModalPageHelperService::verifyIfModalIsAvailableForEveryone()
ModalPageHelperService::verifyIfUserHasAccessOnModal in src/Service/ModalPageHelperService.php
Method to verify if User Has Access on Modal.

File

src/Service/ModalPageHelperService.php, line 81

Class

ModalPageHelperService
Modal Page Helper Service Class.

Namespace

Drupal\modal_page\Service

Code

public function verifyIfModalIsAvailableForEveryone($modal) {
  $roles = $modal
    ->getRoles();
  if (empty(array_filter($roles))) {
    return TRUE;
  }
  return FALSE;
}