You are here

class AccessUnpublishedServiceProvider in Access unpublished 8

Decorates the access_check.latest_revision service.

Hierarchy

Expanded class hierarchy of AccessUnpublishedServiceProvider

File

src/AccessUnpublishedServiceProvider.php, line 13

Namespace

Drupal\access_unpublished
View source
class AccessUnpublishedServiceProvider extends ServiceProviderBase {

  /**
   * {@inheritdoc}
   */
  public function alter(ContainerBuilder $container) {
    if ($container
      ->hasDefinition('access_check.latest_revision')) {
      $container
        ->register('access_unpublished.access_check.latest_revision', LatestRevisionCheck::class)
        ->setDecoratedService('access_check.latest_revision')
        ->addArgument(new Reference('access_unpublished.access_check.latest_revision.inner'))
        ->addTag('access_check', [
        'applies_to' => '_content_moderation_latest_version',
      ]);
    }
  }

}

Members

Namesort descending Modifiers Type Description Overrides
AccessUnpublishedServiceProvider::alter public function Modifies existing service definitions. Overrides ServiceProviderBase::alter
ServiceProviderBase::register public function Registers services to the container. Overrides ServiceProviderInterface::register 1