70 likes | 191 Views
Symfony2 - Step-by-step. Week 3 UserBundle Authentication Authorization Events Services. Week 3 – Symfony 2 Advanced. Purpose: blog application Requirements: User management Authorization Authentication Services Events. 1 – UserBundle. Requirements: Add LikipeUserBundle
E N D
Symfony2 - Step-by-step • Week 3 • UserBundle • Authentication • Authorization • Events • Services
Week 3 – Symfony2 Advanced • Purpose: blog application • Requirements: • User management • Authorization • Authentication • Services • Events
1 – UserBundle • Requirements: • Add LikipeUserBundle • Add User entity • Add C.R.U.D. for User • Tutorial: http://symfony.com/doc/current/book/doctrine.html
2 – Authentication • Requirements: • Login/logout with User entity • UserProvider • Tutorial: http://symfony.com/doc/current/cookbook/security/entity_provider.html • Achievement: • UserInterface • Note: • Password need to be encoded
3 – Authorization • Requirements: • Only ROLE_USER can see routes from LikipeBlogBundle • Only ROLE_ADMIN can see routes from LikipeUserBundle • Tutorial: http://symfony.com/doc/current/cookbook/security/entity_provider.html#authenticating-someone-against-a-database • Achievement: • User’s roles • Access control by Role • Note: • Must use security.yml configuration
3 – Services • Requirements: • Create a service “likipe_log” (in LikipeBlogBundle) • “likipe_log” will save messages in /web/likipe.log file • Tutorial: http://symfony.com/doc/current/book/service_container.html • Achievement: • Service configuration • Service terminology • Note: • Must use “bundle” service.yml configuration
4 – Events • Requirements: • Auto-add “created” for entities before persits • Page hits for blog page. • Tutorial: • http://symfony.com/doc/current/cookbook/doctrine/event_listeners_subscribers.html • http://symfony.com/doc/current/components/event_dispatcher/introduction.html • Achievement: • Listener on Doctrine • Listener on Kernel