Fixed permission error when accessing samples page.

This commit is contained in:
Matej Zrimšek 2018-02-09 19:20:06 +01:00
parent 4c87fb4a55
commit f21c794a95
2 changed files with 3 additions and 3 deletions

View file

@ -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

View file

@ -109,7 +109,7 @@
</button>
<% end %>
<% if can_assign_sample_to_module?(@my_module) %>
<% if module_page? && can_assign_sample_to_module?(@my_module) %>
<button type="button" class="btn btn-default"
id="assignSamples" onclick="$(this).next().click();" disabled>
<span class="glyphicon glyphicon-ok-circle"></span>