You are here

public function UpdateAccessCheck::check in FullCalendar 8.4

Same name and namespace in other branches
  1. 8.5 src/Access/UpdateAccessCheck.php \Drupal\fullcalendar\Access\UpdateAccessCheck::check()
  2. 8 src/Access/UpdateAccessCheck.php \Drupal\fullcalendar\Access\UpdateAccessCheck::check()
  3. 8.2 src/Access/UpdateAccessCheck.php \Drupal\fullcalendar\Access\UpdateAccessCheck::check()
  4. 8.3 src/Access/UpdateAccessCheck.php \Drupal\fullcalendar\Access\UpdateAccessCheck::check()

File

src/Access/UpdateAccessCheck.php, line 23

Class

UpdateAccessCheck
@todo.

Namespace

Drupal\fullcalendar\Access

Code

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();
}