Feature: Automatic registration of AccessItemInterface 

Description 

EXT:deepltranslate_core provides the \AccessItemInterface to define access subtypes to use as Custom Permission Options grouped as deepltranslate.

These items are now automatically registered through the Symfony Dependency Injection container by simply providing autoconfigured classes implementing \AccessItemInterface.

No manual registration required anymore.

Example 

Implement custom access class:

EXT:my_ext/Classes/Access/CustomAccess.php
<?php

namespace MyVendor\MyExt\Access;

use WebVision\Deepltranslate\Core\Access\AccessItemInterface;

final class CustomAccess implements AccessItemInterface
{
    public function getIdentifier(): string
    {
        return 'customAccess';
    }

    public function getTitle(): string
    {
        return sprintf(
            '%s:%s',
            'LLL:EXT:my_ext/Resources/Private/Language/locallang.xlf',
            'be_groups.deepltranslate_access.items.customAccess.title',
        );
    }

    public function getDescription(): string
    {
        return sprintf(
            '%s:%s',
            'LLL:EXT:my_ext/Resources/Private/Language/locallang.xlf',
            'be_groups.deepltranslate_access.items.customAccess.description',
        );
    }

    public function getIconIdentifier(): string
    {
        return 'custom-access-logo';
    }
}
Copied!

Impact 

Classes implementing \AccessItemInterface defined in extensions are now automatically registered and possible provide any access items which have not been registered manually before.

This can be mitigated by using #[Exclude] attribute on the class or exclude it from the autoconfigure load configuration in Configuration/Services.yaml.