You are here

public function DataPolicy::entityOverviewAccess in Open Social 8.2

Same name and namespace in other branches
  1. 8.9 modules/custom/social_gdpr/src/Controller/DataPolicy.php \Drupal\social_gdpr\Controller\DataPolicy::entityOverviewAccess()
  2. 8.3 modules/custom/social_gdpr/src/Controller/DataPolicy.php \Drupal\social_gdpr\Controller\DataPolicy::entityOverviewAccess()
  3. 8.4 modules/custom/social_gdpr/src/Controller/DataPolicy.php \Drupal\social_gdpr\Controller\DataPolicy::entityOverviewAccess()
  4. 8.5 modules/custom/social_gdpr/src/Controller/DataPolicy.php \Drupal\social_gdpr\Controller\DataPolicy::entityOverviewAccess()
  5. 8.6 modules/custom/social_gdpr/src/Controller/DataPolicy.php \Drupal\social_gdpr\Controller\DataPolicy::entityOverviewAccess()
  6. 8.7 modules/custom/social_gdpr/src/Controller/DataPolicy.php \Drupal\social_gdpr\Controller\DataPolicy::entityOverviewAccess()
  7. 8.8 modules/custom/social_gdpr/src/Controller/DataPolicy.php \Drupal\social_gdpr\Controller\DataPolicy::entityOverviewAccess()
  8. 10.0.x modules/custom/social_gdpr/src/Controller/DataPolicy.php \Drupal\social_gdpr\Controller\DataPolicy::entityOverviewAccess()
  9. 10.1.x modules/custom/social_gdpr/src/Controller/DataPolicy.php \Drupal\social_gdpr\Controller\DataPolicy::entityOverviewAccess()

Check if data policy is created.

Return value

\Drupal\Core\Access\AccessResult The access result.

Overrides DataPolicy::entityOverviewAccess

File

modules/custom/social_gdpr/src/Controller/DataPolicy.php, line 20

Class

DataPolicy
Class DataPolicy.

Namespace

Drupal\social_gdpr\Controller

Code

public function entityOverviewAccess() {
  $access = parent::entityOverviewAccess();
  if ($access
    ->isForbidden() && $this
    ->currentUser()
    ->hasPermission('edit data policy')) {
    $access = AccessResult::allowed();
  }
  return $access;
}