You are here

public function DataPolicy::agreementAccess in Data Policy 8

Check access to agreement page.

Return value

\Drupal\Core\Access\AccessResultInterface Allow to open page when a user was not give consent on a current version of data policy.

1 string reference to 'DataPolicy::agreementAccess'
data_policy.routing.yml in ./data_policy.routing.yml
data_policy.routing.yml

File

src/Controller/DataPolicy.php, line 347

Class

DataPolicy
Class DataPolicy.

Namespace

Drupal\data_policy\Controller

Code

public function agreementAccess() {
  if ($this->dataPolicyConsentManager
    ->needConsent()) {
    return AccessResult::allowed();
  }
  return AccessResult::forbidden();
}