added new permission for dropdown actions

This commit is contained in:
zmagod 2016-08-24 10:56:30 +02:00
parent f918746946
commit 27d77bc73f
2 changed files with 8 additions and 1 deletions

View file

@ -328,6 +328,13 @@ module PermissionHelper
# ---- EXPERIMENT PERMISSIONS ----
def can_view_experiment_actions(experiment)
can_edit_experiment(experiment) &&
can_clone_experiment(experiment) &&
can_move_experiment(experiment) &&
can_archive_experiment(experiment)
end
def can_create_experiment(project)
is_user_or_higher_of_project(project)
end

View file

@ -2,7 +2,7 @@
<div class="panel panel-default experiment-panel"
data-id="<%= experiment.id %>">
<div class="panel-heading">
<% if is_user_or_higher_of_project @project %>
<% if can_view_experiment_actions experiment %>
<div class="dropdown pull-right">
<button class="btn btn-link dropdown-toggle"
type="button"