On Jueves, 24 de Septiembre de 2009 18:40:44 alexp escribió:
> I found this as a guide but read also the performance issues of
> checking every record in the row, whilst overriding _list_actions
>
> <% active_scaffold_config.action_links.each :record do |link| -%>
> <% if controller.respond_to? link.security_method
> if controller.method(link.security_method).arity == 0
> next if !controller.send(link.security_method)
> else
> next if !controller.send(link.security_method, record)
> end
> end -%>
> <td>
> <%= record.authorized_for?(:action => link.crud_type) ?
> render_action_link(link, url_options) : "<a class='disabled'>#
> {link.label}</a>" -%>
> </td>
> <% end -%>
>
> Its a big concern with lots of data - what;s better? any ideas?
> thanks again
I think you don't need send the record to link.security_method, you can use
model security instead.
--
Sergio Cambra .:: entreCables S.L. ::.
Mariana Pineda 23, 50.018 Zaragoza
T) 902 021 404 F) 976 52 98 07 E) [email protected]
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"ActiveScaffold : Ruby on Rails plugin" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/activescaffold?hl=en
-~----------~----~----~----~------~----~------~--~---