AnsweredAssumed Answered

Dynamically add role after login

Question asked by djoguet on Dec 1, 2015
Latest reply on Dec 4, 2015 by Francesca Shiekh



I tried to add role dynamically after login.


The problem is that visible elements are not refreshed after the login action.


I created a logic hook with the following code


$role = new ACLRole(); $role->retrieve("XXXXXXXXXXX");          if (!$bean->check_role_membership($role->name))  {      $role->set_relationship('acl_roles_users', array( 'role_id' => $role->id, 'user_id' => $bean->id), false); }

The role is well added but it not takes effect directly.


Is there a solution? Refresh roles? Refresh display?


Thank you.