Restricting user access to certain admin tabs

Hey guys,

Is there a quick and dirty way I can make a certain user type (say
developer) have access to certain tabs in the admin?

We have some custom extensions we made that we’d like to give a
customer access to but not the rest of the admin interface.

Thanks,


Travis B.
Not sent from my iPhone.

Still there is no ACL (http://en.wikipedia.org/wiki/Access_control_list)
support in Radiant.

If the tabs are generated by a custom extension, they you may verify

there that the logged in user has the rights to use it.

 /AITOR

In your extensions you can specify this by adding:

admin.tabs.add “tab name”, “/admin/path/to/tab”, :visibility
=> :developer

If you also want to change other tabs, you can add this:

admin.tabs[“tab name”].visibility = [:developer]

Or change :developer to :admin, if you only want the admin to be able
to change whatever the name of the tab is, for example “Pages”.

Greetings

Hans-Christian Fjeldberg
[email protected]

Hans-Christian Fjeldberg wrote:

to change whatever the name of the tab is, for example “Pages”.
That will only hide the tabs. It won’t prevent people from getting to
the URL. He might try something like this on the controller in the
activate method of an extension:

Admin::ControllerName.only_allow_access_to(
:index, :new, :edit, :remove,
:when => [:admin],
:denied_url => { :controller => ‘page’, :action => ‘index’ },
:denied_message => ‘You must have admin privileges to perform this
action.’
)


John L.
http://wiseheartdesign.com

Travis B. wrote:

Interesting little hack.

I am curious, are their plans to do some basic access control stuff?

Beyond what we already have? Maybe. I’d love to see it extracted into a
extension somehow so that the system could be replaced with whatever
flavor your prefer.


John L.
http://wiseheartdesign.com

Interesting little hack.

I am curious, are their plans to do some basic access control stuff?

Thanks!


Travis B.
Not sent from my iPhone.

I was looking through the Rails 2.0 stuff and it looks like they have
overhauled the permissions piece quite a bit. If/when Radiant goes to
Rails
2.0 we should get that functionality for “free” right?

Later…
Richard

Yes, an extension would be nice… maybe it’s something we can look
at doing.

Thanks!


Travis B.
Not sent from my iPhone.

Richard H. wrote:

I was looking through the Rails 2.0 stuff and it looks like they have
overhauled the permissions piece quite a bit. If/when Radiant goes to Rails
2.0 we should get that functionality for “free” right?

I’m not familiar with that. What are you referring to?


John L.
http://wiseheartdesign.com

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs