##// END OF EJS Templates
Fixed: document listing shows on "my page" when viewing documents is disabled for the role (#1772)....
Jean-Philippe Lang -
r1765:09eba46ec1a6
parent child
Show More
@@ -1,8 +1,9
1 1 <h3><%=l(:label_document_plural)%></h3>
2 2
3 <% project_ids = @user.projects.select {|p| @user.allowed_to?(:view_documents, p)}.collect(&:id) %>
3 4 <%= render(:partial => 'documents/document',
4 5 :collection => Document.find(:all,
5 6 :limit => 10,
6 7 :order => "#{Document.table_name}.created_on DESC",
7 :conditions => "#{Document.table_name}.project_id in (#{@user.projects.collect{|m| m.id}.join(',')})",
8 :include => [:project])) unless @user.projects.empty? %> No newline at end of file
8 :conditions => "#{Document.table_name}.project_id in (#{project_ids.join(',')})",
9 :include => [:project])) unless project_ids.empty? %> No newline at end of file
General Comments 0
You need to be logged in to leave comments. Login now