Questions tagged [sonata-user-bundle]

Integrates the `FOS/UserBundle` in the Sonata Admin Project to add some features related to the users.

Integrates the FOS/UserBundle in the Sonata Admin Project and adds some features:

  • AdminBundle: add user and group management
  • EasyExtends: allows to generate Application level model
  • Features: User profile dashboard, user profile menu, Google Authenticator support (optional), …

The roles to be assigned to users are splitted in 2 parts:

  • editable: the roles the current user is allowed to assign to other users

(permission or role MASTER)

  • readonly: the roles assigned to the current user, however the current

user is only allowed to see them

When using ACL, the UserBundle prevents normal user to change settings of super-admin users.

To find more information :

244 questions
10
votes
1 answer

Adding customised validation rules to SonataUserBundle

I have installed SonataUserBundle according to the docs and it all works fine. Except that I cannot add custom validation rules. My understanding is that the new rules should be added to a new Validation Group and then config.yml is updated to tell…
caponica
  • 3,788
  • 4
  • 32
  • 48
9
votes
2 answers

Remove specific routes per user role in Sonata without SonataUserBundle

I make use of SonataAdminBundle in Symfony 3. Because I use Symfony 3, I still can't make use of SonataUserBundle. So I am using SonataAdminBundle with FOSUserBundle only. Now what I try to achieve is to hide specific routes per role. For example, I…
Mentos93
  • 581
  • 1
  • 7
  • 28
9
votes
3 answers

Call to method setCurrentUri fails in Symfony/SonataUserBundle setup

I am trying to set up Symfony with the SonataUserBundle. User registration and login works fine. When I try to call up the /profile view, however I get the following error: Attempted to call method "setCurrentUri" on class "Knp\Menu\MenuItem" in…
matt_jay
  • 1,241
  • 1
  • 15
  • 33
7
votes
1 answer

Sonata User Bundle + Symfony 3.x

I use Symfony 3.0.6, Sontata Admin Bundle 3.0.0 and the Doctrine ORM Admin Bundle on dev-master. The user bundle doesnt work even with dev-master. Is there a solution for Symfony 3.x yet? Your requirements could not be resolved to an installable set…
user1878703
  • 103
  • 1
  • 4
6
votes
2 answers

Symfony2 - The block type sonata.user.block.menu does not exist

i have one exception: An exception has been thrown during the rendering of a template ("The block type sonata.user.block.menu does not exist") in SonataUserBundle:Profile:action.html.twig at line 27. I have intalled a FOSUserBundle +…
6
votes
2 answers

Display items on dashboard according to user role

I'm new to Symfony2, and for the needs of my company I'm using Sonata Admin and User bundles. I would like to know if it is possible to hide or show items on the dashboard according to the role of a logged user. For example, I have several entities…
5
votes
2 answers

How to override SonataUserBundle templates

I've installed SonataAdminBundle and SonataUserBundle and I'm trying to override some twig templates. I've done succesfully with all except with user_block.html.twig This is my proyect ../app/Resources/ directory structure: Resources/ ├──…
xabi82
  • 111
  • 3
  • 9
5
votes
3 answers

Unable to generate a URL for "page_slug", after creating a user

I have a strange problem. I installed and configured SonataUserBundle to work with FosUserBundle and SonataAdminBundle. The installed went without any problems and everything seems to be working perfectly, except when I create another user via…
Etienne Noël
  • 5,988
  • 6
  • 48
  • 75
5
votes
3 answers

How to install SonataDoctrineMongoDBAdminBundle properly?

I am really getting nervous because of lacking of enough resource for installing SonataDoctrineMongoDBAdminBundle and it's dependencies like sonataUserBundle. I have been trying to install this bundle for 15 days. I did everyting agaian and again…
4
votes
1 answer

Sonata Admin Bundle: How to add a "Delete" button in form, to the entities on the nested entities list?

In the parent entity I can do something like that: protected function configureFormFields(FormMapper $formMapper) { $formMapper->add('units', 'sonata_type_collection', [ 'required' => true, 'by_reference' => false, …
4
votes
1 answer

ClassNotFoundException: Attempted to load class "FOSUserBundle" from namespace "FOS\UserBundle"

(Using WampServer on Windows 10.) I followed the official documentation in order to install Sonata User Bundle over Symfony. I get the following error message (1/1) ClassNotFoundException Attempted to load class "FOSUserBundle" from namespace…
TTT
  • 1,848
  • 2
  • 30
  • 60
4
votes
1 answer

Sonata bundle, how can I get current logged in user?

Lets say I have a Car Entity. Other than typical Car properties I have updatedBy attribute In sonata I created a CRUD admin page using AppBundle\Admin\CarAdmin.php Inside the class CarAdmin I have the required methods like configureListFields,…
4
votes
1 answer

Class '...\Entity\User' does not have a method 'getGenderList'

I'm working with the Sonata Admin bundle for the backend of my website. My user table in my database looks like this: id (PK) username email password salt last_login created_at company_id (FK) My User entity looks like the…
nielsv
  • 6,540
  • 35
  • 111
  • 215
4
votes
1 answer

Clean usage of groups and roles in FOSUserBundle

I'm currently working on a Symfony2 project. It is based on Sonata and uses SonataUserBundle/FOSUserBundle for managing users. The initial development has been badly done and I'm in the process of refactoring a lot of it. The application defines…
Didier Ghys
  • 30,396
  • 9
  • 75
  • 81
4
votes
2 answers

FOSUserBundle use MongoDB config validation instead of ORM

I got a Symfony2 project with FOSUserBundle and SonataUserBundle. Both bundles are configured to use ORM only. # FOS User Bundle fos_user: db_driver: orm firewall_name: main user_class: MyBundle\Entity\User group: …
Nicolas Janel
  • 3,025
  • 1
  • 28
  • 31
1
2 3
16 17