demontpx / user-bundle
Provider users and user management to my Symfony apps
Installs: 458
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 2
Forks: 0
Open Issues: 0
Type:symfony-bundle
Requires
- php: >=7.4
- ext-json: *
- demontpx/util-bundle: ^0.6
- doctrine/orm: ^2.7
- sensio/framework-extra-bundle: ^5.5
- symfony/config: ^4.4|^5.0
- symfony/dependency-injection: ^4.4|^5.0
- symfony/event-dispatcher-contracts: ^1.1|^2.0
- symfony/form: ^4.4|^5.0
- symfony/http-foundation: ^4.4|^5.0
- symfony/security-core: ^4.4|^5.0
Requires (Dev)
- doctrine/doctrine-bundle: ^1.8|^2.0
- doctrine/doctrine-fixtures-bundle: ^3.3
- phpunit/phpunit: ^9.1
- symfony/yaml: ^4.4|^5.0
- twig/twig: ^2.4|^3.0
Suggests
- doctrine/doctrine-fixtures-bundle: For functional testing with configured users
README
This couples the FOSUserBundle to my Symfony apps
Installation
Add the user bundle to your symfony project:
$ compose require demontpx/user-bundle
Configuration
User roles can be added in your config/packages/demontpx_user.yaml
:
demontpx_user:
roles:
ROLE_ADMIN: Administrator
ROLE_GROUP_MANAGER: Group manager
ROLE_SUPER: Super user
ORM Data fixtures for testing can be added in config/packages/test/demontpx_user.yml
:
demontpx_user:
fixtures:
user: ~
admin: { roles: [ROLE_ADMIN] }
super_user: { roles: [ROLE_ADMIN, ROLE_SUPER] }
Users will get the same password as the user name, and you will be able to use the UserWebTestCase
class from the util bundle for your user-aware functional tests. You will also need to add this to your config/packages/test/security.yml
to enable this:
security:
firewalls:
main: # Replace this with your firewall name
http_basic: ~
Additional javascript and stylesheets
A SCSS file is located at assets/user-bundle.scss
which could be imported.
Some elements have the select2
class which could be enhanced by enabling select2 on them.