Project

General

Profile

Defect #1 » application_helper.rb-PATCH.txt

Todd McGrath, 2008-02-03 10:48

 
Index: C:/rubyworkspace/redmine-trunk/app/helpers/application_helper.rb
===================================================================
--- C:/rubyworkspace/redmine-trunk/app/helpers/application_helper.rb (revision 127)
+++ C:/rubyworkspace/redmine-trunk/app/helpers/application_helper.rb (working copy)
@@ -44,6 +44,11 @@
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], options[:action])
end
+
+ # Display a link if user is authorized
+ def link_to_if_authorized_li(name, options = {}, html_options = nil, *parameters_for_method_reference)
+ "<li>" + link_to(name, options, html_options, *parameters_for_method_reference) + "</li>" if authorize_for(options[:controller], options[:action])
+ end
# Display a link to user's account page
def link_to_user(user)
(4-4/4)