Jump to content

Recommended Posts

Posted

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.

Posted

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. 

Posted

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.

  • 2 years later...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...