Update permission checks for reports [SCI-6105] (#3570)

This commit is contained in:
aignatov-bio 2021-10-01 14:25:52 +02:00 committed by GitHub
parent 3eb2c98cce
commit 34b0aec5b7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,5 +1,5 @@
<ul>
<% project.experiments.includes(:my_modules).active.sort_by { |e| @project_contents[:experiments].index(e.id) || @project_contents[:experiments].length if report }.each do |experiment| %>
<% project.experiments.viewable_by_user(current_user, current_team).includes(:my_modules).active.sort_by { |e| @project_contents[:experiments].index(e.id) || @project_contents[:experiments].length if report }.each do |experiment| %>
<li class="experiment-element">
<div class="experiment-block">
<span class="sci-checkbox-container">
@ -22,7 +22,7 @@
</div>
</div>
<ul class="experiment-contents collapse in" id="experimentContentContainer<%= experiment.id %>">
<% experiment.my_modules.active.sort_by { |m| @project_contents[:my_modules].index(m.id) || @project_contents[:my_modules].length if report }.each do |my_module| %>
<% experiment.my_modules.viewable_by_user(current_user, current_team).active.sort_by { |m| @project_contents[:my_modules].index(m.id) || @project_contents[:my_modules].length if report }.each do |my_module| %>
<li class="experiment-my-module">
<span class="sci-checkbox-container">
<input type="checkbox" value="<%= my_module.id %>" class="sci-checkbox report-my-module-checkbox"