sonata admin - Symfony 2.8: How to prevent editing user's service fields -


i'm newby in symfony, excuse ignorance.

in project use sonata user bundle, user entity extended several fields. of them can edited user himself, while others serviceable , can edited admin. question is: how ensure security when editing information user?
see 2 ways:
1. use custom validation constraints check user's role.
2. use one-to-one related entity own admin.
perhaps there standard ways accomplish task?

thanks in advance!

upd:
problem there 1 entity (user) can edited different places: admin area , public area. naturally, forms admin , public areas different, there possibility attacker can forge form , edit fields accessible administrator. therefore, want protect them @ level of entity. possible?

there many cases of security. can use @security has_role('role_admin') annotation action or in twig is_granted display or not field or use custom voter check if user can edit or delete un objet @ this. describe need you.


Comments

Popular posts from this blog

angular - Ionic slides - dynamically add slides before and after -

minify - Minimizing css files -

Add a dynamic header in angular 2 http provider -