Quoting LluĂs <enboig@gmail.com>:
Well, that was an example, the permission of a user to belong to a role or not can change during its session; so I need a way to make it change dynamically during the session.
If you want to trap the user to a new set of permissions during the session you would need to use hook_form_alter and reload the global $user. Something like the untested function function foo_form_alter(&$form, &$form_state, $form_id) { global $user $user = user_load(array('uid' => $user->uid)); } This would reload the $user object for each form modifying the roles to the current set. If you only want certain forms to do this you can filter with the form id. -- Earnie -- http://r-feed.com/ -- http://for-my-kids.com/ -- http://www.4offer.biz/ -- http://give-me-an-offer.com/