aboutsummaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/policies/workbench_policy.rb11
-rw-r--r--app/views/workbenches/show.html.slim2
2 files changed, 13 insertions, 0 deletions
diff --git a/app/policies/workbench_policy.rb b/app/policies/workbench_policy.rb
new file mode 100644
index 000000000..7b925e91a
--- /dev/null
+++ b/app/policies/workbench_policy.rb
@@ -0,0 +1,11 @@
+class WorkbenchPolicy < ApplicationPolicy
+ class Scope < Scope
+ def resolve
+ scope
+ end
+ end
+
+ def update?
+ true
+ end
+end
diff --git a/app/views/workbenches/show.html.slim b/app/views/workbenches/show.html.slim
index 159aa8ea2..5c2468296 100644
--- a/app/views/workbenches/show.html.slim
+++ b/app/views/workbenches/show.html.slim
@@ -3,6 +3,8 @@
- content_for :page_header_content do
.row.mb-sm
.col-lg-12.text-right
+ - if policy(Workbench).update?
+ = link_to t('workbenches.actions.configure'), edit_workbench_path(@workbench), class: 'btn btn-primary'
- if policy(Referential).create?
= link_to t('actions.import'), workbench_imports_path(@workbench), class: 'btn btn-primary'
= link_to t('actions.add'), new_workbench_referential_path(@workbench), class: 'btn btn-primary'