public function MediaRevisionPermissions::mediaRevisionTypePermissions in Media Revisions UI 8
Same name and namespace in other branches
- 2.0.x src/MediaRevisionPermissions.php \Drupal\media_revisions_ui\MediaRevisionPermissions::mediaRevisionTypePermissions()
Returns an array of media revision type permissions.
Return value
array The media type permissions.
See also
\Drupal\user\PermissionHandlerInterface::getPermissions()
1 string reference to 'MediaRevisionPermissions::mediaRevisionTypePermissions'
File
- src/
MediaRevisionPermissions.php, line 50
Class
- MediaRevisionPermissions
- Provides dynamic permissions for each media revision type.
Namespace
Drupal\media_revisions_uiCode
public function mediaRevisionTypePermissions() {
$perms = [];
// Generate media revision permissions for all media types.
$media_types = $this->entityTypeManager
->getStorage('media_type')
->loadMultiple();
foreach ($media_types as $type) {
$perms += $this
->buildPermissions($type);
}
return $perms;
}