Authorized for action_link?

9 views
Skip to first unread message

GamaFranco

unread,
Jan 23, 2008, 7:28:44 PM1/23/08
to ActiveScaffold : Ruby on Rails plugin
Hi,

I would like to know if there is a way to enable/disable an action
link action.

For exame, I would like to check the user credentials to support or
not the following action:

active_scaffold :game do |config|
config.action_links.add("enroll", {:action=>"register", :type
=> :record})
end

I can do the check for CRUD actions, but dunno how to make it for an
action_link.

Thanks,
Tiago Franco

Meech

unread,
Jan 24, 2008, 3:36:12 PM1/24/08
to ActiveScaffold : Ruby on Rails plugin
Pass :security_method=> in the link parms.

GamaFranco

unread,
Jan 26, 2008, 12:45:11 PM1/26/08
to ActiveScaffold : Ruby on Rails plugin
Hi,

Thanks for the reply. But The action is to be checked at record level.
How do I access the record in the method that checks the security?
Mind that the method needs to be defined in the controller.

Thanks,
Tiago Franco

Sergio Cambra

unread,
Jan 26, 2008, 1:55:26 PM1/26/08
to actives...@googlegroups.com
El Sábado, 26 de Enero de 2008, GamaFranco escribió:
> Hi,
>
> Thanks for the reply. But The action is to be checked at record level.
> How do I access the record in the method that checks the security?
> Mind that the method needs to be defined in the controller.

At record level you can define authorized_for_#{action}, action must be a
crud action (create, read, update, destroy) and you must set link's
crud_type to that action

GamaFranco

unread,
Jan 27, 2008, 4:45:48 PM1/27/08
to ActiveScaffold : Ruby on Rails plugin
Hi,

I see. But I need to make verifications at the record level for
action_links. Is there an easy way to do it?

Thanks,
Tiago Franco
Reply all
Reply to author
Forward
0 new messages