public function MediaLibraryGutenbergOpener::checkAccess in Gutenberg 8
Same name and namespace in other branches
- 8.2 src/MediaLibraryGutenbergOpener.php \Drupal\gutenberg\MediaLibraryGutenbergOpener::checkAccess()
Checks media library access.
Parameters
\Drupal\media_library\MediaLibraryState $state: The media library.
\Drupal\Core\Session\AccountInterface $account: The user for which to check access.
Return value
\Drupal\Core\Access\AccessResultInterface The access result.
Overrides MediaLibraryOpenerInterface::checkAccess
See also
https://www.drupal.org/project/drupal/issues/3038254
File
- src/
MediaLibraryGutenbergOpener.php, line 21
Class
- MediaLibraryGutenbergOpener
- The media library opener for Gutenberg editor.
Namespace
Drupal\gutenbergCode
public function checkAccess(MediaLibraryState $state, AccountInterface $account) {
return AccessResult::allowedIf($account
->hasPermission('gutenberg administer'));
}