<% if User.current.logged? %> <% if (is_project_manager?(User.current, @project) || file.author_id == User.current.id) && project_contains_attachment?(@project,file) %> <% if (delete_allowed || User.current.id == file.author_id) && file.container_id == @project.id && file.container_type == "Project" %> <% end %> <%else%> <% end %> <% end %>