symfony - SonataAdminBundle: set permission depending on field value -


i have working sonataadmin+fosuser (without sonatauserbundle) setup roles , acl enabled. working fine, every user has access different admins depending on roles.

now need go bit deeper. restrict access 1 of admin depending on value of association of underlying entity.

lets have this:

/**  * @orm\entity  */ class content {     /**      * @var string      *      * @orm\manytoone(targetentity="contenttype", inversedby="contents")      */     private $type; }  /**  * @orm\entity  */ class contenttype {     /**      * @var string      *      * @orm\column(name="name", type="string", length=255)      */     private $name; } 

i following:

  • users role_xxxxx : have access contents content type name 'xxxxx'
  • users role_yyyyy : have access contents content type name 'yyyyy' ...

of course means when creating new content or filtering list of contents, users should not able select content type on don't have permission.

i have tried no luck:

php app/console acl:set --role=role_xxxxx master mybundle/contenttype:2 


Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -