changeset 713:ebca856bd627 feature_36

Fixes Bug #313: Only shows projects for which user is allowed to manage bibliography
author luisf <luis.figueira@eecs.qmul.ac.uk>
date Fri, 23 Sep 2011 18:15:01 +0100
parents a1e0728d1e02
children 1ea217fdcdbf 378aca14739f 7018aa84e3a8
files vendor/plugins/redmine_bibliography/app/helpers/publications_helper.rb
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/vendor/plugins/redmine_bibliography/app/helpers/publications_helper.rb	Fri Sep 23 12:23:25 2011 +0100
+++ b/vendor/plugins/redmine_bibliography/app/helpers/publications_helper.rb	Fri Sep 23 18:15:01 2011 +0100
@@ -12,8 +12,10 @@
   def projects_check_box_tags(name, projects)
     s = ''
     projects.sort.each do |project|
-      s << "<label>#{ check_box_tag name, project.id, false } #{link_to_project project}</label>\n"
-      s << '<br />'
+      if User.current.allowed_to?(:edit_publication, project) 
+        s << "<label>#{ check_box_tag name, project.id, false } #{link_to_project project}</label>\n"
+        s << '<br />'
+      end
     end
 
     s