mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-01-19 14:01:03 +08:00
added new permission for dropdown actions
This commit is contained in:
parent
f918746946
commit
27d77bc73f
2 changed files with 8 additions and 1 deletions
|
@ -328,6 +328,13 @@ module PermissionHelper
|
||||||
|
|
||||||
# ---- EXPERIMENT PERMISSIONS ----
|
# ---- 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)
|
def can_create_experiment(project)
|
||||||
is_user_or_higher_of_project(project)
|
is_user_or_higher_of_project(project)
|
||||||
end
|
end
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
<div class="panel panel-default experiment-panel"
|
<div class="panel panel-default experiment-panel"
|
||||||
data-id="<%= experiment.id %>">
|
data-id="<%= experiment.id %>">
|
||||||
<div class="panel-heading">
|
<div class="panel-heading">
|
||||||
<% if is_user_or_higher_of_project @project %>
|
<% if can_view_experiment_actions experiment %>
|
||||||
<div class="dropdown pull-right">
|
<div class="dropdown pull-right">
|
||||||
<button class="btn btn-link dropdown-toggle"
|
<button class="btn btn-link dropdown-toggle"
|
||||||
type="button"
|
type="button"
|
||||||
|
|
Loading…
Reference in a new issue