Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By Guybrush Threepwood on
I know I can use the menu_alter hook to remove menus and such for certain users. Now I have the desired menus and configuration options for the user except for some of the things on the performance page. How can I remove the caching and bandwidth optimization sections of the performance page?
Thanks!
Comments
That is an admin page, a very
That is an admin page, a very limited number of people should have access.
Yes this is true.
Yes, this is true, but I have an editor that needs to be able to clear the cache to do his work. I made a module to give him access only to the configuration > performance page. But in this page there are two sections besides the clear cache button that I don't want the user to have access to. Thus, I need a way to take these options out of the performance page.
I would suggest a custom page
I would suggest a custom page with just a "Clear cache" link/button (It can use the path from the performance page).
Thanks.
This will work, but I already finished my custom module. The needed information can be found in this link: http://drupal.stackexchange.com/questions/115731/how-do-i-take-out-the-c...
#access is your friend
In form alter, you can set the #access = False for any element that you don't want to be available for specific users.