Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- security:
- providers:
- users_db:
- entity:
- class: AppBundle:User
- property: email
- admin_db:
- memory:
- users:
- admin:
- password: root
- roles: 'ROLE_ADMIN'
- encoders:
- AppBundleEntityUser: bcrypt
- SymfonyComponentSecurityCoreUserUser: plaintext
- firewalls:
- # disables authentication for assets and the profiler, adapt it according to your needs
- dev:
- pattern: ^/(_(profiler|wdt)|css|images|js)/
- security: false
- admin:
- pattern: ^/admin
- provider: admin_db
- anonymous: ~
- # logout_on_user_change: true
- form_login:
- login_path: admin_login
- check_path: admin_login
- default_target_path: admin_homepage
- logout:
- path: /logout
- target: /
- main:
- pattern: ^/
- provider: users_db
- anonymous: ~
- logout_on_user_change: true
- # activate different ways to authenticate
- # https://symfony.com/doc/current/security.html#a-configuring-how-your-users-will-authenticate
- # http_basic: ~
- # https://symfony.com/doc/current/security/form_login_setup.html
- form_login:
- login_path: user_login
- check_path: user_login
- default_target_path: user_profile
- logout:
- path: /logout
- target: /
- access_control:
- - { path: ^/login, roles: IS_AUTHENTICATED_ANONYMOUSLY }
- - { path: ^/admin/login, roles: IS_AUTHENTICATED_ANONYMOUSLY }
- - { path: ^/user, roles: ROLE_USER }
- - { path: ^/admin, roles: ROLE_ADMIN }
- <?php
- namespace AppBundleEntity;
- use DoctrineORMMapping as ORM;
- /**
- * Admin
- *
- * @ORMEntity(repositoryClass="AppBundleRepositoryAdminRepository")
- */
- class Admin
- {
- /**
- * @var int
- *
- * @ORMId
- * @ORMGeneratedValue(strategy="AUTO")
- */
- private $id;
- }
- No identifier/primary key specified for Entity "AppBundleEntityAdmin". Every Entity must have an identifier/primary key.
Add Comment
Please, Sign In to add comment