2

I gave the site admin role permission to administer blocks, but the problem is in admin/structure/block page, there is a tab that shows the admin theme name (Rubik).

he can click on Rubik but doesn't have permission to see the page. what I want is to hide the tab.

other issue is in admin_menu module under structure > blocks there is a Rubik item too, which shouldn't be there too since the user doesn't have the permission to edit admin theme blocks.

So I'm wondering why does rubik block page link shows up!

  • simply use css to hide the tab, that's it. It shows because you selected the admin theme as rubik – Bala Oct 23 '13 at 11:15
  • 2
    well I already thought of that but it's not the right approach to achieve this. it still renders in page which is wrong, but thanks for the tip. – Sohail Oct 23 '13 at 11:44
  • I cannot even reproduce this problem yet. Do you have any modules enabled that might be restricting access to those pages? - In drupal core, as long as the theme is either enabled or the admin theme you should get access to that page. – rooby Oct 23 '13 at 12:53
  • You have probably give the same user the permission to view the administration theme. – Елин Й. Oct 23 '13 at 20:52
  • I actually did that too but he doesn't suppose to see a link where he doesn't have permission to see the content of it. – Sohail Oct 27 '13 at 8:14
2
+25

I have had such a issue in the recent past, the only solution to this is the "Block Access" Module.

  • Do you also know the cause of the problem? – rooby Oct 23 '13 at 12:02
  • While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. – Bala Oct 23 '13 at 12:18
  • Please don't add "thank you" as an answer. Instead, vote up the answers that you find helpful. – Ankit Agrawal Oct 23 '13 at 12:24
  • @rooby : "administer blocks" permission gives access to the blocks page irrespective of the themes. Hence when we visit this page, the entire theme's blocks will be shown. As in this case, it should not be like that. – Gladiator Oct 23 '13 at 12:30
  • 1
    This module helps alot but the user still has access to such page like: admin/structure/block/list/ADMINTHEMENAME/add , whilst you can manage restriction to the blocks added before. also the admin role can still have access to the admin name tab I mentioned earlier in the question, but thanks for introducing it. – Sohail Oct 27 '13 at 8:21
1

In theory, you could write a module that uses hook_menu_alter(). It would modify the access callback element in the "admin theme" menu item (and maybe sub-menu items?). The callback function would check user_access('administer themes'). You could probably write this in 30 minutes or less.

That would cover both cases -- the block admin page and the admin menu.

  • Thanks for the tip, but i'm pretty sure I counldn't write such thing since im not a programmmer. – Sohail Oct 29 '13 at 8:14
  • The thing is that even if you were a programmer this probably wouldn't solve your problem because hook_menu_alter is cached within drupal cache system so it cannot be role dependent. I would recommend using a different approach - do not use an admin theme or use a module for switching a theme based on path such as ThemeKey. – Bery Aug 31 '14 at 20:03

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.