You are here

public function SocialAlbumController::checkGroupAlbumAccess in Open Social 10.1.x

Same name and namespace in other branches
  1. 10.3.x modules/social_features/social_album/src/Controller/SocialAlbumController.php \Drupal\social_album\Controller\SocialAlbumController::checkGroupAlbumAccess()
  2. 10.0.x modules/social_features/social_album/src/Controller/SocialAlbumController.php \Drupal\social_album\Controller\SocialAlbumController::checkGroupAlbumAccess()
  3. 10.2.x modules/social_features/social_album/src/Controller/SocialAlbumController.php \Drupal\social_album\Controller\SocialAlbumController::checkGroupAlbumAccess()

Checks access to the group album creation page.

Parameters

\Drupal\group\Entity\GroupInterface $group: The group object.

Return value

\Drupal\Core\Access\AccessResultInterface The access result.

1 string reference to 'SocialAlbumController::checkGroupAlbumAccess'
social_album.routing.yml in modules/social_features/social_album/social_album.routing.yml
modules/social_features/social_album/social_album.routing.yml

File

modules/social_features/social_album/src/Controller/SocialAlbumController.php, line 336

Class

SocialAlbumController
Returns responses for Album routes.

Namespace

Drupal\social_album\Controller

Code

public function checkGroupAlbumAccess(GroupInterface $group) {
  $access = $this
    ->checkGroupAccess($group);
  if ($access
    ->isAllowed()) {
    return $group
      ->getGroupType()
      ->getContentPlugin('group_node:album')
      ->createEntityAccess($group, $this
      ->currentUser())
      ->andIf($this
      ->checkUserAlbumsAccess());
  }
  return $access;
}