# Hide pages/snippets/layouts admin tabs?

**URL:** <https://www.ruby-forum.com/t/hide-pages-snippets-layouts-admin-tabs/89254>\
**Category:** Radiant CMS\
**Created:** [March 19, 2007, 12:37am UTC](https://www.ruby-forum.com/t/hide-pages-snippets-layouts-admin-tabs/89254 "2007-03-19T00:37:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Karl\_Doody](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/7cd45c/32.png) [@Karl\_Doody](https://www.ruby-forum.com/u/Karl_Doody)\
**Post date:** [March 19, 2007, 12:37am UTC](https://www.ruby-forum.com/t/hide-pages-snippets-layouts-admin-tabs/89254/1 "2007-03-19T00:37:33Z")

</div>

Hi all,

Just a quickie, is there a way (through the users/roles?) to hide the  
page, snippets, and layouts admin tabs? i.e. with the aim of having a  
user who, once logged in, can only see/use the tabs created through  
my extensions.

Kind regards,  
-Karl

---

<div class="post-metadata">

**Author:** ![Karl\_Doody](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/7cd45c/32.png) [@Karl\_Doody](https://www.ruby-forum.com/u/Karl_Doody)\
**Post date:** [March 19, 2007, 1:49am UTC](https://www.ruby-forum.com/t/hide-pages-snippets-layouts-admin-tabs/89254/2 "2007-03-19T01:49:39Z")

</div>

Restrict the pages tab to users with the dev role:

admin.tabs[‘Pages’].visibility = [:dev]

Dan.

---

<div class="post-metadata">

**Author:** ![Karl\_Doody](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/7cd45c/32.png) [@Karl\_Doody](https://www.ruby-forum.com/u/Karl_Doody)\
**Post date:** [March 19, 2007, 1:48pm UTC](https://www.ruby-forum.com/t/hide-pages-snippets-layouts-admin-tabs/89254/3 "2007-03-19T13:48:37Z")

</div>

Daniel S. wrote:

> Restrict the pages tab to users with the dev role:
> 
> admin.tabs[‘Pages’].visibility = [:dev]

Well, not quite. That only hides the tab from the user’s view. To be  
secure you will need to use the only\_allow\_access\_to class method inside  
the body of the controller definition. Here’s a good example from the  
LayoutController:

only\_allow\_access\_to :index, :new, :edit, :remove,  
:when =\> [:developer, :admin],  
:denied\_url =\> { :controller =\> ‘page’, :action =\> ‘index’ },  
:denied\_message =\> ‘You must have developer privileges to perform  
this action.’

[http://dev.radiantcms.org/radiant/browser/trunk/radiant/app/controllers/admin/layout\_controller.rb](http://dev.radiantcms.org/radiant/browser/trunk/radiant/app/controllers/admin/layout_controller.rb)

–  
John L.  
[http://wiseheartdesign.com](http://wiseheartdesign.com)
