kr-digital / sonata-user-bundle
Installs: 49
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Type:symfony-bundle
Requires
- php: ^7.1.3 || ^7.2
- sonata-project/admin-bundle: ^3.9
- symfony/config: ^3.2|^4.2
- symfony/dependency-injection: ^3.2|^4.2
- symfony/form: ^3.2|^4.2
- symfony/framework-bundle: ^3.2|^4.2
- symfony/http-kernel: ^3.2|^4.2
- symfony/options-resolver: ^3.2|^4.2
- symfony/security-core: ^3.2|^4.2
- symfony/translation: ^3.2|^4.2
Requires (Dev)
- friendsofphp/php-cs-fixer: ^2.13
- roave/security-advisories: dev-master
- symfony/phpunit-bridge: ^4.0
README
Requirements
- php ^7.1.3
- symfony ^3.2
- sonata-project/admin-bundle ^3.1
<?php declare(strict_types=1); namespace AppBundle\Admin; use KR\SonataUserBundle\Form\Type\RolesMatrixType; use KR\SonataUserBundle\Form\Type\SecurityRolesType; use Sonata\AdminBundle\Admin\AbstractAdmin; use Sonata\AdminBundle\Form\FormMapper; // ... class UserAdmin extends AbstractAdmin { protected $translationDomain = 'UserAdmin'; // ... protected function configureFormFields(FormMapper $form) { $form ->add('roles', RolesMatrixType::class /** SecurityRolesType::class */, [ 'expanded' => true, 'multiple' => true, 'required' => false, ]) ; // ... } }
Exclude resource.
Add show_in_roles_matrix
into configuration
# app/config/services.yml # with sonata-project/doctrine-orm-admin-bundle app.admin.user: class: AppBundle\Admin\UserAdmin arguments: [~, AppBundle\Entity\User, ~] tags: - { name: sonata.admin, manager_type: orm, group: Users, label: User, icon: '<i class="fa fa-user"></i>', show_in_roles_matrix: false } public: true