CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Adding roles to users in Drupal (via the API). Impact on CiviCRM ?
Pages: [1]

Author Topic: Adding roles to users in Drupal (via the API). Impact on CiviCRM ?  (Read 2406 times)

mathran

  • Guest
Adding roles to users in Drupal (via the API). Impact on CiviCRM ?
January 14, 2008, 07:13:19 am
Hello,

I am adding roles to users in Drupal (via the API) and I need to know how civicrm reacts on that ?

$array = array( 'roles' => array( 4=>4 ));
user_save($user, $array , $category = 'account');

And 4 is number of a drupal role with access rights on civicrm.
If I put a print statement in the check function in Drupal.php then the access rights on Civicrm seems to be OK.
But still , there is no right to start CiviCRM.
If I change the role via the administer menu of drupal then everything works fine.

The reason for this all is that the user is a memebr of organic group and the group has access to CiviCRM.

Thanks a lot,
Martin

mathran

  • Guest
Re: Adding roles to users in Drupal (via the API). Impact on CiviCRM ?
January 20, 2008, 06:51:29 am
Hello,

I found the problem. It got nothing to do with CiviCRM.  ;D

Drupal caches the menu's and if you save the user with user_save($user) then the menu_cache is not updated or empty.
I fixed it by deleting the menu_cache for this user and then everytrhing works fine.

So, it works fine and goodbye.


Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Adding roles to users in Drupal (via the API). Impact on CiviCRM ?

This forum was archived on 2017-11-26.