You are here

public function DataPolicyConsentManager::needConsent in Data Policy 8

Check if user gave consent on a current version of data policy.

Return value

bool TRUE if consent is needed.

Overrides DataPolicyConsentManagerInterface::needConsent

File

src/DataPolicyConsentManager.php, line 96

Class

DataPolicyConsentManager
Defines the Data Policy Consent Manager service.

Namespace

Drupal\data_policy

Code

public function needConsent() {
  return $this
    ->isDataPolicy() && !$this->currentUser
    ->hasPermission('without consent');
}