You are here

function social_album_node_create_access in Open Social 10.1.x

Same name and namespace in other branches
  1. 10.3.x modules/social_features/social_album/social_album.module \social_album_node_create_access()
  2. 10.0.x modules/social_features/social_album/social_album.module \social_album_node_create_access()
  3. 10.2.x modules/social_features/social_album/social_album.module \social_album_node_create_access()

Implements hook_ENTITY_TYPE_create_access().

File

modules/social_features/social_album/social_album.module, line 191
The Social Album module.

Code

function social_album_node_create_access(AccountInterface $account, array $context, $entity_bundle) {
  if ($entity_bundle === 'album' && \Drupal::routeMatch()
    ->getRouteName() === 'view.albums.page_albums_overview' && \Drupal::routeMatch()
    ->getRawParameter('user') !== $account
    ->id()) {
    return AccessResult::forbidden();
  }
  return AccessResult::neutral();
}