You are here

public function GroupMedia::createAccess in Group Media 8

Performs access check for the create operation.

This method is supposed to be overwritten by extending classes that do their own custom access checking.

Parameters

\Drupal\group\Entity\GroupInterface $group: The group to check for content creation access.

\Drupal\Core\Session\AccountInterface $account: The user for which to check access.

Return value

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

Overrides GroupContentEnablerBase::createAccess

Deprecated

in Group 1.0, will be removed before Group 2.0. Retrieve the access handler from the plugin manager instead.

File

src/Plugin/GroupContentEnabler/GroupMedia.php, line 113

Class

GroupMedia
Provides a content enabler for nodes.

Namespace

Drupal\groupmedia\Plugin\GroupContentEnabler

Code

public function createAccess(GroupInterface $group, AccountInterface $account) {
  $plugin_id = $this
    ->getPluginId();
  return GroupAccessResult::allowedIfHasGroupPermission($group, $account, "create {$plugin_id} entity");
}