You are here

class UpdateAccessCheck in FullCalendar 8

Same name and namespace in other branches
  1. 8.5 src/Access/UpdateAccessCheck.php \Drupal\fullcalendar\Access\UpdateAccessCheck
  2. 8.2 src/Access/UpdateAccessCheck.php \Drupal\fullcalendar\Access\UpdateAccessCheck
  3. 8.3 src/Access/UpdateAccessCheck.php \Drupal\fullcalendar\Access\UpdateAccessCheck
  4. 8.4 src/Access/UpdateAccessCheck.php \Drupal\fullcalendar\Access\UpdateAccessCheck

@todo.

Hierarchy

Expanded class hierarchy of UpdateAccessCheck

1 string reference to 'UpdateAccessCheck'
fullcalendar.services.yml in ./fullcalendar.services.yml
fullcalendar.services.yml
1 service uses UpdateAccessCheck
access_check.fullcalendar.update in ./fullcalendar.services.yml
Drupal\fullcalendar\Access\UpdateAccessCheck

File

src/Access/UpdateAccessCheck.php, line 13

Namespace

Drupal\fullcalendar\Access
View source
class UpdateAccessCheck implements AccessInterface {

  /**
   * {@inheritdoc}
   */
  public function access(EntityInterface $entity, AccountInterface $account) {
    return AccessResult::allowedIf($entity && $this
      ->check($entity, $account))
      ->cachePerUser();
  }
  public function check(EntityInterface $entity, AccountInterface $account) {
    return $account
      ->hasPermission('administer content') || $account
      ->hasPermission('update any fullcalendar event') || $account
      ->hasPermission('edit any ' . $entity
      ->bundle() . ' content') || $account
      ->hasPermission('edit own ' . $entity
      ->bundle() . ' content') && $entity->uid == $account
      ->id();
  }

}

Members