ns/simple-user-bundle

Basic pre-configured user admin and auth bundle for NSAdminBundle

1.2.12 2021-02-15 20:23 UTC

This package is auto-updated.

Last update: 2024-04-16 03:16:28 UTC


README

Basic pre-configured user admin and auth bundle for NSAdminBundle

##Installation

Require SimpleUserBundle composer require ns/simple-user-bundle

add it to your project bundles.php NS\SimpleUserBundle\NSSimpleUserBundle::class => ['all' => true],

and require the routing config in your project routes.yaml file. NOTE: The SimpleUserBundle routes must be included before the AdminBundle routes.

ns_simple_user:
    resource: "@NSSimpleUserBundle/Resources/config/routing.yml"
    prefix:  /

ns_admin:
    resource: "@NSAdminBundle/Resources/config/routing.yml"
    prefix:  /admin

Update your project security.yaml file:

security:
    encoders:
        NS\SimpleUserBundle\Security\SecurityUser:
            algorithm: bcrypt
        NS\SimpleUserBundle\Entity\User\User:
            algorithm: bcrypt
    providers:
        app:
            id: NS\SimpleUserBundle\Security\SecurityUserProvider
    firewalls:
        main:
            form_login:
                login_path: login
                check_path: login_check
            logout:
                path: logout
                target: login
    access_control:
        - { path: ^/logout$, role: IS_AUTHENTICATED_ANONYMOUSLY }
        - { path: ^/login$, role: IS_AUTHENTICATED_ANONYMOUSLY }

The user admin list can be accessed with the admin_user_list route.