]> Raphaƫl G. Git Repositories - userbundle/blobdiff - Resources/config/packages/rapsys_user.yaml
Adapt entity and user checker to match with symfony classes and interfaces
[userbundle] / Resources / config / packages / rapsys_user.yaml
index a89540896d5c23830e77cddd3628fffc096c7b0e..27789890c790ec10998dc6f55786b5761adbfd74 100644 (file)
@@ -1,11 +1,26 @@
 #Service configuration
 services:
+    #Register security context service
+    rapsys_user.access_decision_manager:
+        class: 'Symfony\Component\Security\Core\Authorization\AccessDecisionManager'
+        public: true
+        arguments: [ [ '@security.access.role_hierarchy_voter' ] ]
     #Register default controller
     Rapsys\UserBundle\Controller\DefaultController:
-        arguments: [ '@service_container', '@translator', '@router' ]
-        autowire: true
+        arguments: [ '@service_container', '@doctrine', '@security.user_password_hasher', '@logger', '@mailer.mailer', '@doctrine.orm.default_entity_manager', '@router', '@rapsys_pack.slugger_util', '@request_stack', '@translator' ]
         tags: [ 'controller.service_arguments' ]
-    #Register slugger utils service
-    rapsys.slugger:
-        class: 'Rapsys\UserBundle\Utils\Slugger'
-        arguments: [ '@service_container' ]
+    #Register Authentication success handler
+    security.authentication.success_handler:
+        class: 'Rapsys\UserBundle\Handler\AuthenticationSuccessHandler'
+        arguments: [ '@router', {} ]
+    #Register Authentication failure handler
+    security.authentication.failure_handler:
+        class: 'Rapsys\UserBundle\Handler\AuthenticationFailureHandler'
+        arguments: [ '@http_kernel', '@security.http_utils', {}, '@logger', '@service_container', '@router', '@rapsys_pack.slugger_util' ]
+    #Register default logout listener
+    security.logout.listener.default:
+        class: 'Rapsys\UserBundle\Listener\LogoutListener'
+        arguments: [ '@service_container', '/', '@router' ]
+    #Register security user checker
+    security.user_checker:
+        class: 'Rapsys\UserBundle\Checker\UserChecker'