On Jueves, 8 de Abril de 2010 16:58:21 helmerj escribió: > Hi I have an admin backend that does list all users of a system. I did > add a custom link that calls a function. in case a listed user is not > active, the user is activated (@user.active => true ) and an > activation email is send. In case the usert is alerady activated I > render an error message. > > To be more intuitive: > > Is it possible to make the custom action link conditional so that it > shows only for non active users? I had a look at the security chapter > of the AS wiki, but the model based security which would apply here > only does support the regular crud actions (show edit and delete)and > no custom actions (which I tried nevertheless, to no avail of > course... :-) ) > Any help on this would be greatly appreciated.
With latest master you can define security methods for custom actions. If your action is called activate, you can define authorized_for_activate? in your model. > > Cheers J. -- 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.
