UpdateAccessCheck.php in FullCalendar 8.2
Same filename and directory in other branches
Namespace
Drupal\fullcalendar\AccessFile
src/Access/UpdateAccessCheck.phpView source
<?php
namespace Drupal\fullcalendar\Access;
use Drupal\Core\Access\AccessResult;
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Session\AccountInterface;
use Drupal\Core\Routing\Access\AccessInterface;
/**
* @todo.
*/
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();
}
}
Classes
Name | Description |
---|---|
UpdateAccessCheck | @todo. |