Answers.Body: <p>I typically take it out of the black toolbar menu (disable it) and then use <a href="https://www.drupal.org/project/shortcutperrole" rel="nofollow noreferrer">shortcut-per-role</a> to add a CiviCRM menu option to users with certain roles (i.e. in the grey toolbar).</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-06-14T02:12:18.807Z
Answers.LastActivityDate: 2018-06-14T07:25:02.260Z
Answers.LastEditDate: 2018-06-14T07:25:02.260Z
Answers.UserDisplayName: KarinG - Semper IT
Answers.Body: <p>You can use <a href="https://api.drupal.org/api/drupal/modules%21system%21system.api.php/function/hook_menu_alter/7.x" rel="nofollow noreferrer"><code>hook_menu_alter</code></a> and hide/remove main <code>civicrm</code> menu item by check logged in user role through $user variable.</p>
  
  <p>Something like this:</p>
  
  <pre><code>function hook_menu_alter(){
  
     global $user;
     if (in_array('ROLE NAME', $user-&gt;roles)) {
         //do stuff here
     }
  }
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-06-14T20:18:58.840Z
Answers.Text: I don’t think this requires a custom drupal module
Answers.UserDisplayName: KarinG - Semper IT
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-06-14T16:41:16.203Z
Answers.LastActivityDate: 2018-06-14T16:41:16.203Z
Answers.UserDisplayName: Hassan Farooq
Answers.Body: <p>Did you had a look at the <a href="https://www.drupal.org/project/menu_per_role" rel="nofollow noreferrer">Menu per Role module</a>? </p>
  
  <p>I have no experience with that module but it sounds like the module which could solve your problem.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-06-14T08:14:16.847Z
Answers.LastActivityDate: 2018-06-14T08:14:16.847Z
Answers.UserDisplayName: Jaap Jansma - CiviCooP
Body: <p>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.</p>
  
  <p>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? </p>
  
  <p>I am using a Drupal module called <a href="https://www.drupal.org/project/admin_menu" rel="nofollow noreferrer">admin_menu_toolbar</a> without any customizations, however, the problem persists using the default <code>toolbar</code> also.</p>
  
  <p>Drupal 7.59
  CiviCRM 5.1.2</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-06-14T00:59:21.927Z
Comments.Text: 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)
Comments.UserDisplayName: petednz - fuzion
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-06-14T01:28:56.673Z
Comments.Text: 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`.
Comments.UserDisplayName: Christia
Tags: <drupal><menu>
Title: How to remove CIviCRM from menu for some roles
ThreadText: # How to remove CIviCRM from menu for some roles
  
  (Asked by: username_0 on 2018-06-14)
  
  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](https://www.drupal.org/project/admin_menu) without any customizations, however, the problem persists using the default `toolbar` also.
  
  Drupal 7.59
  CiviCRM 5.1.2
  
  **Tags:** drupal, menu
  
  > **Comments:**
  > **username_1**: 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)  
  > **username_0**: 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`.  
  
  ---
  
  ## 3 answers
  
  ### Answer by username_2 on 2018-06-14. Score: 1 | Accepted answer
  
  I typically take it out of the black toolbar menu (disable it) and then use [shortcut-per-role](https://www.drupal.org/project/shortcutperrole) to add a CiviCRM menu option to users with certain roles (i.e. in the grey toolbar).
  
  
  ---
  
  ### Answer by username_3 on 2018-06-14. Score: 1
  
  You can use [`hook_menu_alter`](https://api.drupal.org/api/drupal/modules%21system%21system.api.php/function/hook_menu_alter/7.x) 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
     }
  }
  
  ```
  
  > **Comments:**
  > **username_2**: I don’t think this requires a custom drupal module  
  
  ---
  
  ### Answer by username_4 on 2018-06-14. Score: 0
  
  Did you had a look at the [Menu per Role module](https://www.drupal.org/project/menu_per_role)?
  
  I have no experience with that module but it sounds like the module which could solve your problem.
  
  
  ---
  
  