function MediaAccessControlHandler::checkCreateAccess
Same name in other branches
- 9 core/modules/media/src/MediaAccessControlHandler.php \Drupal\media\MediaAccessControlHandler::checkCreateAccess()
- 8.9.x core/modules/media/src/MediaAccessControlHandler.php \Drupal\media\MediaAccessControlHandler::checkCreateAccess()
- 11.x core/modules/media/src/MediaAccessControlHandler.php \Drupal\media\MediaAccessControlHandler::checkCreateAccess()
Overrides EntityAccessControlHandler::checkCreateAccess
File
-
core/
modules/ media/ src/ MediaAccessControlHandler.php, line 153
Class
- MediaAccessControlHandler
- Defines an access control handler for media items.
Namespace
Drupal\mediaCode
protected function checkCreateAccess(AccountInterface $account, array $context, $entity_bundle = NULL) {
$permissions = [
'administer media',
'create media',
'create ' . $entity_bundle . ' media',
];
return AccessResult::allowedIfHasPermissions($account, $permissions, 'OR');
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.