Index: vendor/plugins/classic_pagination/test/pagination_helper_test.rb =================================================================== --- vendor/plugins/classic_pagination/test/pagination_helper_test.rb (revision 5236) +++ vendor/plugins/classic_pagination/test/pagination_helper_test.rb (working copy) @@ -10,7 +10,7 @@ def setup @controller = Class.new do attr_accessor :url, :request - def url_for(options, *parameters_for_method_reference) + def url_for(options) url end end Index: app/helpers/application_helper.rb =================================================================== --- app/helpers/application_helper.rb (revision 5236) +++ app/helpers/application_helper.rb (working copy) @@ -26,9 +26,9 @@ extend Forwardable def_delegators :wiki_helper, :wikitoolbar_for, :heads_for_wiki_formatter - # Return true if user is authorized for controller/action, otherwise false - def authorize_for(controller, action) - User.current.allowed_to?({:controller => controller, :action => action}, @project) + # Return true if user is authorized for controller/action in context, otherwise false + def authorize_for(controller, action, context = @project) + User.current.allowed_to?({:controller => controller, :action => action}, context) end # Display a link if user is authorized @@ -36,15 +36,15 @@ # @param [String] name Anchor text (passed to link_to) # @param [Hash] options Hash params. This will checked by authorize_for to see if the user is authorized # @param [optional, Hash] html_options Options passed to link_to - # @param [optional, Hash] parameters_for_method_reference Extra parameters for link_to - def link_to_if_authorized(name, options = {}, html_options = nil, *parameters_for_method_reference) - link_to(name, options, html_options, *parameters_for_method_reference) if authorize_for(options[:controller] || params[:controller], options[:action]) + # @param [optional, Object] context Context object + def link_to_if_authorized(name, options = {}, html_options = nil, context = @project) + link_to(name, options, html_options) if authorize_for(options[:controller] || params[:controller], options[:action], context) end # Display a link to remote if user is authorized - def link_to_remote_if_authorized(name, options = {}, html_options = nil) + def link_to_remote_if_authorized(name, options = {}, html_options = nil, context = @project) url = options[:url] || {} - link_to_remote(name, options, html_options) if authorize_for(url[:controller] || params[:controller], url[:action]) + link_to_remote(name, options, html_options) if authorize_for(url[:controller] || params[:controller], url[:action], context) end # Displays a link to user's account page if active Index: app/views/projects/settings/_versions.rhtml =================================================================== --- app/views/projects/settings/_versions.rhtml (revision 5236) +++ app/views/projects/settings/_versions.rhtml (working copy) @@ -17,7 +17,7 @@