diff --git a/app/permissions/experiment.rb b/app/permissions/experiment.rb index 4cf808cc0..7f06eac77 100644 --- a/app/permissions/experiment.rb +++ b/app/permissions/experiment.rb @@ -72,9 +72,9 @@ Canaid::Permissions.register_for(MyModule) do end # module: assign/unassign sample + # NOTE: Use 'module_page? &&' before calling this permission! can :assign_sample_to_module do |user, my_module| - module_page? && - user.is_technician_or_higher_of_project?(my_module.experiment.project) + user.is_technician_or_higher_of_project?(my_module.experiment.project) end # module: complete/uncomplete diff --git a/app/views/shared/_samples.html.erb b/app/views/shared/_samples.html.erb index 4f1edf62e..c2888eae8 100644 --- a/app/views/shared/_samples.html.erb +++ b/app/views/shared/_samples.html.erb @@ -109,7 +109,7 @@ <% end %> - <% if can_assign_sample_to_module?(@my_module) %> + <% if module_page? && can_assign_sample_to_module?(@my_module) %>