You are here

public function EventMeta::addDefaultAccess in RNG - Events and Registrations 3.x

Same name and namespace in other branches
  1. 8.2 src/EventMeta.php \Drupal\rng\EventMeta::addDefaultAccess()
  2. 8 src/EventMeta.php \Drupal\rng\EventMeta::addDefaultAccess()

Clones the site default access rules onto the event.

If the site default rules change in the future, the access rules for this event will not get automatically updated.

Access rules determine registration operation grants.

Overrides EventMetaInterface::addDefaultAccess

File

src/EventMeta.php, line 640

Class

EventMeta
Meta event wrapper for RNG.

Namespace

Drupal\rng

Code

public function addDefaultAccess() {
  $rules = $this
    ->getDefaultRules('rng_event.register');
  foreach ($rules as $rule) {
    $rule
      ->save();
  }
}