2
votes

I have an entity "Vehicles" which has ManyToOne connection with another entity - "Department". I could set "department" property to a user. I would like this user (who has ROLE_DEPARTMENT_MANAGER role), to be able to see (list, create, delete, etc.) only the vehicles from his own department.

When using Roles I could restrict access to specific actions. I think I should use ACL, but I am not sure how to do it and how Sonata Admin will behave.

I found similar question here, but nobody had answer it: Sonata Admin Bundle filter show entity from role user

Would you tell me how to do it in Sonata Admin Bundle.

2

2 Answers

0
votes

I have just written on article on this exact subject (I know the question is old but it might help for future reference): http://www.theodo.fr/blog/2016/09/sonata-for-symfony-hide-your-filters/