Martijn Geerts Posted January 9, 2013 Share Posted January 9, 2013 Sometimes I wish to visually hide certain aspects of the admin when the logged-in user is not super user. When <body class='the-current-user-role'> is added, it's easy to just "display: none" for some elements you want to hide. Link to comment Share on other sites More sharing options...
ryan Posted January 9, 2013 Share Posted January 9, 2013 This would be pretty easy to add to any admin theme: <body class="<?php foreach($user->roles as $role) echo "role_" . $role->name . " "; ?>"> But whether it's advisable is another question. If you don't want the user to have access to something, it's best that the logic of the page knows not to even display or accept input to it. Otherwise it's a potential security hole. Though for non-security related display adjustments, it seems like a fine way to go. Link to comment Share on other sites More sharing options...
Martijn Geerts Posted January 9, 2013 Author Share Posted January 9, 2013 For me it's just to the form-builder and custom settings pages that I want to hide just for normal editors. The Way you describe it now is the way I do it now. The problem with me is that I update to often & sometimes forget or just overwrite previously set things I changed. Link to comment Share on other sites More sharing options...
WillyC Posted January 9, 2013 Share Posted January 9, 2013 you.can move admins themed to /site/templates-admin/ no mas.worry on upgraded 2 Link to comment Share on other sites More sharing options...
ryan Posted January 10, 2013 Share Posted January 10, 2013 I'm happy to add this to the default admin theme too. 4 Link to comment Share on other sites More sharing options...
Robin S Posted September 5, 2015 Share Posted September 5, 2015 Don't think this made it into the default admin theme, so +1 for this. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now