1

We have a group of users who have privileged, but very limited, access to functions on our website. Chiefly, they are able to add blogs. That's about it. We do not want them being able to go in and access the CiviCRM. The list of CiviCRM-related privileges are appropriate and everything works beautifully except one piece I am stuck on.

In my current design, the blogger users use the same admin menu, which only shows what they are given permission to see with the exception of a link to the CiviCRM. Since they don't have access to the CiviCRM backend, the link just renders an error. It's a dead link. How can I get it to disappear for this type of user?

I am using a Drupal module called admin_menu_toolbar without any customizations, however, the problem persists using the default toolbar also.

Drupal 7.59 CiviCRM 5.1.2

  • never experienced this. on any admin menus we have, civicrm only shows for those with permission - and afaik that is the 'drupal way' ie it won't show a link to something you don't have permission to see. can you flesh out more about how your admin menu is constructed and the path for the URL (hopefully it is as simple as ensuring you only use a relative link) – petednz - fuzion Jun 14 '18 at 0:59
  • The link shows up automatically and it's the default admin menu, no customizations. The only privileges given to bloggers (and anonymous) is for their profile creation, etc., to update their CRM record, for them to see contribution forms, etc. Let me try the default Toolbar and see if that helps. I just remembered that I'm using a toolbar called admin_menu_toolbar. – Christia Jun 14 '18 at 1:28
1

I typically take it out of the black toolbar menu (disable it) and then use shortcut-per-role to add a CiviCRM menu option to users with certain roles (i.e. in the grey toolbar).

1

You can use hook_menu_alter and hide/remove main civicrm menu item by check logged in user role through $user variable.

Something like this:

function hook_menu_alter(){

   global $user;
   if (in_array('ROLE NAME', $user->roles)) {
       //do stuff here
   }
}
  • I don’t think this requires a custom drupal module – KarinG - Semper IT Jun 14 '18 at 20:18
0

Did you had a look at the Menu per Role module?

I have no experience with that module but it sounds like the module which could solve your problem.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.