Guest User

Untitled

a guest
Dec 9th, 2018
189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.25 KB | None | 0 0
  1. security:
  2.  
  3. providers:
  4. users_db:
  5. entity:
  6. class: AppBundle:User
  7. property: email
  8.  
  9. admin_db:
  10. memory:
  11. users:
  12. admin:
  13. password: root
  14. roles: 'ROLE_ADMIN'
  15.  
  16.  
  17. encoders:
  18. AppBundleEntityUser: bcrypt
  19. SymfonyComponentSecurityCoreUserUser: plaintext
  20.  
  21. firewalls:
  22. # disables authentication for assets and the profiler, adapt it according to your needs
  23. dev:
  24. pattern: ^/(_(profiler|wdt)|css|images|js)/
  25. security: false
  26.  
  27. admin:
  28. pattern: ^/admin
  29. provider: admin_db
  30. anonymous: ~
  31. # logout_on_user_change: true
  32.  
  33. form_login:
  34. login_path: admin_login
  35. check_path: admin_login
  36. default_target_path: admin_homepage
  37.  
  38. logout:
  39. path: /logout
  40. target: /
  41.  
  42. main:
  43. pattern: ^/
  44. provider: users_db
  45. anonymous: ~
  46. logout_on_user_change: true
  47. # activate different ways to authenticate
  48.  
  49. # https://symfony.com/doc/current/security.html#a-configuring-how-your-users-will-authenticate
  50. # http_basic: ~
  51.  
  52. # https://symfony.com/doc/current/security/form_login_setup.html
  53. form_login:
  54. login_path: user_login
  55. check_path: user_login
  56. default_target_path: user_profile
  57.  
  58. logout:
  59. path: /logout
  60. target: /
  61.  
  62. access_control:
  63. - { path: ^/login, roles: IS_AUTHENTICATED_ANONYMOUSLY }
  64. - { path: ^/admin/login, roles: IS_AUTHENTICATED_ANONYMOUSLY }
  65. - { path: ^/user, roles: ROLE_USER }
  66. - { path: ^/admin, roles: ROLE_ADMIN }
  67.  
  68. <?php
  69.  
  70. namespace AppBundleEntity;
  71.  
  72. use DoctrineORMMapping as ORM;
  73.  
  74. /**
  75. * Admin
  76. *
  77. * @ORMEntity(repositoryClass="AppBundleRepositoryAdminRepository")
  78. */
  79. class Admin
  80. {
  81.  
  82. /**
  83. * @var int
  84. *
  85. * @ORMId
  86. * @ORMGeneratedValue(strategy="AUTO")
  87. */
  88. private $id;
  89.  
  90. }
  91.  
  92. No identifier/primary key specified for Entity "AppBundleEntityAdmin". Every Entity must have an identifier/primary key.
Add Comment
Please, Sign In to add comment