You are here

function brightcove_entity_access in Brightcove Video Connect 8

Same name and namespace in other branches
  1. 8.2 brightcove.module \brightcove_entity_access()
  2. 3.x brightcove.module \brightcove_entity_access()

Implements hook_entity_access().

File

./brightcove.module, line 323
Brightcove module.

Code

function brightcove_entity_access(EntityInterface $entity, $operation, AccountInterface $account) {

  // Disable editing/deleting video tags.
  if (($entity instanceof TermInterface && $entity
    ->getVocabularyId() == BrightcoveVideo::TAGS_VID || $entity instanceof VocabularyInterface && $entity
    ->id() == BrightcoveVideo::TAGS_VID) && ($operation == 'update' || $operation == 'delete')) {
    return AccessResult::forbidden();
  }
  return AccessResult::neutral();
}