On Thu, Aug 7, 2008 at 3:15 AM, Vincent Pérès <[EMAIL PROTECTED]>wrote:

>
> I'm using 'page_group_permissions' to create custom group and manage my
> users.
> I would like to restrict access to some extensions, and disable
> associated tab.
> I found this topic :
>
> http://www.nabble.com/Restricting-user-access-to-certain-admin-tabs...-td13416484.html#a13427010
> But they speaked about 'admin' or 'developer' restriction, and I have
> 'cutom roles'. I guess it's possible to acces to 'admin.tabs' and remove
> tabs according to extensions... I would like to do that by an extension,
> without modify the radiant core.
> I don't find the right way to do that... anyone has some idea?
>

Here's what I did:

def activate
  admin.tabs.clear
  admin.tabs.add "Pages",    "/admin/pages", :visibility => [:admin,
:developer]
  admin.tabs.add "Snippets", "/admin/snippets", :visibility => [:admin,
:developer]
  admin.tabs.add "Layouts",  "/admin/layouts", :visibility => [:admin,
:developer]
  ...
end

If you're looking for something like

admin.tabs.add "Pages",    "/admin/pages", :visibility =>
[:my_awesome_group]

you'll need to extend the User model and define my_awesome_group? to return
true if the member is in that group and false otherwise.

Now that I've taken the time to write it out, it sounds rather
straight-forward. Has anyone else done something like this with
page-group-permissions?

--
Tim
_______________________________________________
Radiant mailing list
Post:   Radiant@radiantcms.org
Search: http://radiantcms.org/mailing-list/search/
Site:   http://lists.radiantcms.org/mailman/listinfo/radiant

Reply via email to