diff --git a/src/Bundle/ChillEventBundle/Controller/EventController.php b/src/Bundle/ChillEventBundle/Controller/EventController.php index 069ee5c6d..773593057 100644 --- a/src/Bundle/ChillEventBundle/Controller/EventController.php +++ b/src/Bundle/ChillEventBundle/Controller/EventController.php @@ -15,7 +15,7 @@ use Chill\EventBundle\Entity\Event; use Chill\EventBundle\Entity\Participation; use Chill\EventBundle\Form\EventType; use Chill\EventBundle\Form\Type\PickEventType; -use Chill\EventBundle\Security\Authorization\EventVoter; +use Chill\EventBundle\Security\EventVoter; use Chill\MainBundle\Entity\Center; use Chill\MainBundle\Entity\User; use Chill\MainBundle\Pagination\PaginatorFactory; diff --git a/src/Bundle/ChillEventBundle/Controller/ParticipationController.php b/src/Bundle/ChillEventBundle/Controller/ParticipationController.php index c862c8fd6..59501acd7 100644 --- a/src/Bundle/ChillEventBundle/Controller/ParticipationController.php +++ b/src/Bundle/ChillEventBundle/Controller/ParticipationController.php @@ -15,7 +15,7 @@ use Chill\EventBundle\Entity\Event; use Chill\EventBundle\Entity\Participation; use Chill\EventBundle\Form\ParticipationType; use Chill\EventBundle\Repository\EventRepository; -use Chill\EventBundle\Security\Authorization\ParticipationVoter; +use Chill\EventBundle\Security\ParticipationVoter; use Chill\PersonBundle\Repository\PersonRepository; use Chill\PersonBundle\Security\Authorization\PersonVoter; use Doctrine\Common\Collections\Collection; diff --git a/src/Bundle/ChillEventBundle/DependencyInjection/ChillEventExtension.php b/src/Bundle/ChillEventBundle/DependencyInjection/ChillEventExtension.php index 8ddcab58c..f36e82075 100644 --- a/src/Bundle/ChillEventBundle/DependencyInjection/ChillEventExtension.php +++ b/src/Bundle/ChillEventBundle/DependencyInjection/ChillEventExtension.php @@ -11,8 +11,8 @@ declare(strict_types=1); namespace Chill\EventBundle\DependencyInjection; -use Chill\EventBundle\Security\Authorization\EventVoter; -use Chill\EventBundle\Security\Authorization\ParticipationVoter; +use Chill\EventBundle\Security\EventVoter; +use Chill\EventBundle\Security\ParticipationVoter; use Symfony\Component\Config\FileLocator; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Extension\PrependExtensionInterface; @@ -33,7 +33,7 @@ class ChillEventExtension extends Extension implements PrependExtensionInterface $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../config')); $loader->load('services.yaml'); - $loader->load('services/authorization.yaml'); + $loader->load('services/security.yaml'); $loader->load('services/fixtures.yaml'); $loader->load('services/forms.yaml'); $loader->load('services/repositories.yaml'); diff --git a/src/Bundle/ChillEventBundle/Menu/PersonMenuBuilder.php b/src/Bundle/ChillEventBundle/Menu/PersonMenuBuilder.php index 8abfc7cd6..e14e4c979 100644 --- a/src/Bundle/ChillEventBundle/Menu/PersonMenuBuilder.php +++ b/src/Bundle/ChillEventBundle/Menu/PersonMenuBuilder.php @@ -11,7 +11,7 @@ declare(strict_types=1); namespace Chill\EventBundle\Menu; -use Chill\EventBundle\Security\Authorization\EventVoter; +use Chill\EventBundle\Security\EventVoter; use Chill\MainBundle\Routing\LocalMenuBuilderInterface; use Knp\Menu\MenuItem; use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface; diff --git a/src/Bundle/ChillEventBundle/Menu/SectionMenuBuilder.php b/src/Bundle/ChillEventBundle/Menu/SectionMenuBuilder.php index 341848e42..276324938 100644 --- a/src/Bundle/ChillEventBundle/Menu/SectionMenuBuilder.php +++ b/src/Bundle/ChillEventBundle/Menu/SectionMenuBuilder.php @@ -11,7 +11,7 @@ declare(strict_types=1); namespace Chill\EventBundle\Menu; -use Chill\EventBundle\Security\Authorization\EventVoter; +use Chill\EventBundle\Security\EventVoter; use Chill\MainBundle\Routing\LocalMenuBuilderInterface; use Knp\Menu\MenuItem; use Symfony\Component\Security\Core\Security; diff --git a/src/Bundle/ChillEventBundle/Repository/EventACLAwareRepository.php b/src/Bundle/ChillEventBundle/Repository/EventACLAwareRepository.php index 7b9b027f9..22141b536 100644 --- a/src/Bundle/ChillEventBundle/Repository/EventACLAwareRepository.php +++ b/src/Bundle/ChillEventBundle/Repository/EventACLAwareRepository.php @@ -13,7 +13,7 @@ namespace Chill\EventBundle\Repository; use Chill\EventBundle\Entity\Event; use Chill\EventBundle\Entity\Participation; -use Chill\EventBundle\Security\Authorization\EventVoter; +use Chill\EventBundle\Security\EventVoter; use Chill\MainBundle\Entity\User; use Chill\MainBundle\Security\Authorization\AuthorizationHelperForCurrentUserInterface; use Chill\PersonBundle\Entity\Person; diff --git a/src/Bundle/ChillEventBundle/Security/Authorization/EventVoter.php b/src/Bundle/ChillEventBundle/Security/EventVoter.php similarity index 98% rename from src/Bundle/ChillEventBundle/Security/Authorization/EventVoter.php rename to src/Bundle/ChillEventBundle/Security/EventVoter.php index c88f2804a..0bcf9936c 100644 --- a/src/Bundle/ChillEventBundle/Security/Authorization/EventVoter.php +++ b/src/Bundle/ChillEventBundle/Security/EventVoter.php @@ -9,7 +9,7 @@ declare(strict_types=1); * the LICENSE file that was distributed with this source code. */ -namespace Chill\EventBundle\Security\Authorization; +namespace Chill\EventBundle\Security; use Chill\EventBundle\Entity\Event; use Chill\MainBundle\Entity\User; diff --git a/src/Bundle/ChillEventBundle/Security/Authorization/ParticipationVoter.php b/src/Bundle/ChillEventBundle/Security/ParticipationVoter.php similarity index 98% rename from src/Bundle/ChillEventBundle/Security/Authorization/ParticipationVoter.php rename to src/Bundle/ChillEventBundle/Security/ParticipationVoter.php index ad2e90377..c2cb45206 100644 --- a/src/Bundle/ChillEventBundle/Security/Authorization/ParticipationVoter.php +++ b/src/Bundle/ChillEventBundle/Security/ParticipationVoter.php @@ -9,7 +9,7 @@ declare(strict_types=1); * the LICENSE file that was distributed with this source code. */ -namespace Chill\EventBundle\Security\Authorization; +namespace Chill\EventBundle\Security; use Chill\EventBundle\Entity\Participation; use Chill\MainBundle\Entity\User; diff --git a/src/Bundle/ChillEventBundle/Tests/Repository/EventACLAwareRepositoryTest.php b/src/Bundle/ChillEventBundle/Tests/Repository/EventACLAwareRepositoryTest.php index 4bcaac1f6..758e50d56 100644 --- a/src/Bundle/ChillEventBundle/Tests/Repository/EventACLAwareRepositoryTest.php +++ b/src/Bundle/ChillEventBundle/Tests/Repository/EventACLAwareRepositoryTest.php @@ -12,7 +12,7 @@ declare(strict_types=1); namespace Chill\EventBundle\Tests\Repository; use Chill\EventBundle\Repository\EventACLAwareRepository; -use Chill\EventBundle\Security\Authorization\EventVoter; +use Chill\EventBundle\Security\EventVoter; use Chill\MainBundle\Entity\Center; use Chill\MainBundle\Entity\Scope; use Chill\MainBundle\Entity\User; diff --git a/src/Bundle/ChillEventBundle/config/services/authorization.yaml b/src/Bundle/ChillEventBundle/config/services/authorization.yaml deleted file mode 100644 index 6f382b72e..000000000 --- a/src/Bundle/ChillEventBundle/config/services/authorization.yaml +++ /dev/null @@ -1,18 +0,0 @@ -services: - chill_event.event_voter: - class: Chill\EventBundle\Security\Authorization\EventVoter - arguments: - - "@security.access.decision_manager" - - "@chill.main.security.authorization.helper" - - "@logger" - tags: - - { name: security.voter } - - chill_event.event_participation: - class: Chill\EventBundle\Security\Authorization\ParticipationVoter - arguments: - - "@security.access.decision_manager" - - "@chill.main.security.authorization.helper" - - "@logger" - tags: - - { name: security.voter } diff --git a/src/Bundle/ChillEventBundle/config/services/security.yaml b/src/Bundle/ChillEventBundle/config/services/security.yaml new file mode 100644 index 000000000..a139b72a9 --- /dev/null +++ b/src/Bundle/ChillEventBundle/config/services/security.yaml @@ -0,0 +1,15 @@ +services: + Chill\EventBundle\Security\EventVoter: + autowire: true + autoconfigure: true + tags: + - { name: security.voter } + - { name: chill.role } + + Chill\EventBundle\Security\ParticipationVoter: + autowire: true + autoconfigure: true + tags: + - { name: security.voter } + - { name: chill.role } +