--
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 actives...@googlegroups.com.
To unsubscribe from this group, send email to activescaffol...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/activescaffold?hl=en.
I tried using the class method self.authorized_for_create? and it didn't work, so presumably it's because the CanCan chain is doing the authorizing. I may just try using JS to fix it.
--
You received this message because you are subscribed to the Google Groups "ActiveScaffold : Ruby on Rails plugin" group.
To view this discussion on the web visit https://groups.google.com/d/msg/activescaffold/-/okMjqJCmHI8J.
def create_ignore? (!nested? && active_scaffold_config.list.always_show_create) || !create_authorized? end
It works with master or rails-3.2 branch, it won't work with 3.2.16 because it was fixed later. However, I don't know if it works with cancan.
ActiveScaffold won't disable collection links, so an unauthorized collection link should not be displayed, is not needed to change create_ignore? method. The fix is on commit 8ce243d83ee5e37a9d3d7df29601ea8f55682223
--
You received this message because you are subscribed to the Google Groups "ActiveScaffold : Ruby on Rails plugin" group.
To view this discussion on the web visit https://groups.google.com/d/msg/activescaffold/-/GbvZHQglRm4J.
render_group_action_link(link, options, record)
What method it should use instead?
authorized_for?(:crud_type => link.crud_type, :action => link.action)
You cannot do that with nested_authorized? without adding link parameter, which was my proposal, adding link parameter to check authorization with that call in nested_authorized?
I could do it in traverse, but I don't like it. ActionLinks class should not know nothing about a link is a normal or nested one, should do the same. Another way would be move authorization check to the action link class.
In nested_authorized?, link should have index action for plural associations and nil action for singular associations. Then, links without action should call action_link_to_inline_form, then configure_column_link and finally column_link_authorized?. If it's not authorized it will be rendered like:
<a>action link label</a>
I will change so it gets class="disabled" too.