17

I'm making a website with Drupal 7, and I was looking through the permissions for Taxonomies. I wanted to give the website maintainers a central place to manage the vocabularies and add terms, sort the terms etc. So I gave their role the "Administer vocabularies and terms" permission under Taxonomy. This however resulted in an unwanted complication, mainly it gave them access to create new fields and manage their display ("Manage Fields" and "Manage Display" tabs).

Is there a way to give them access to the Vocabulary and Term edit screen which can be accessed through "Structure > Taxonomy" but however disable the "Manage Fields" and "Manage Display" tabs on the vocabulary edit screen?

I'm quite familiar with the notion of overriding and hooks in Drupal 6, but I'm quite new to Drupal 7 (in fact this is my first D7 website, made about 5 or 6 D6 websites) so I don't mind some coding solutions to this if any. Just looking for an answer or a push in the right direction.

Since no one has answered yet, I wanted to add that I'm willing to look into alternatives to the central area to manage taxonomies (admin/structure/taxonomy). Maybe I could look into creating a page with Views to simulate the taxonomies admin page.

Is it feasible and has anyone done anything like this before?

4 Answers 4

8

I know this was answered a while back, but there's a solution that doesn't require any custom or special modules.

If you disable the core fields ui module, the Manage Fields and Manage Display tabs will not show.

If this is a production site, this should be fine to do as you'll have already configured the fields how you want them. If you ever need to make a change, just enable the module again briefly.

2
  • 1
    +1 This seems like the cleanest, least bulky and quick way to achieve the result.
    – Beebee
    Commented Jul 3, 2013 at 8:41
  • This isn't a workaround, it's a solution that "doesn't require any custom or special modules" and works just fine on every Drupal site ever created. Commented Dec 20, 2014 at 5:11
7

Use field_ui_permissions module which controls whether "Manage Fields" and "Manage Display" tabs should be displayed or not based on role permissions.

3

The permission administer taxonomy is what's used to give field permissions, if you need to give them this permission in order to give them access to taxonomy administration you can create a new permission for the field ui.

The easiest way to set this, is with hook_entity_info_alter hook, since this is where the admin path for the field ui is added and the access permission for them. You could also use hook_menu_alter to change the permission, but this is a bit more work.

2

You might try using the hook_menu_alter() to edit the 'access callback' that are setup in field_ui_menu() function from field_ui.module file. This is where the "Manage Fields" and "Manage Displays" menu items are setup.

In your hook_menu_alter() you could look for these two menu item entries for taxonomy paths (since you would want to keep the Content Type versions of these), and change the 'access callback' to a custom method that checks a new permission you create in hook_permission().

I've done something similar in the past and would be happy to send code if needed.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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