aboutsummaryrefslogtreecommitdiffstats
path: root/app/policies/line_policy.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/policies/line_policy.rb')
-rw-r--r--app/policies/line_policy.rb23
1 files changed, 23 insertions, 0 deletions
diff --git a/app/policies/line_policy.rb b/app/policies/line_policy.rb
new file mode 100644
index 000000000..559f4e2f8
--- /dev/null
+++ b/app/policies/line_policy.rb
@@ -0,0 +1,23 @@
+ class LinePolicy < ApplicationPolicy
+
+ class Scope < Scope
+ def resolve
+ scope
+ end
+ end
+
+ def create_footnote?
+ !archived? && organisation_match? && user.has_permission?('footnotes.create')
+ end
+
+ def edit_footnote?
+ !archived? && organisation_match? && user.has_permission?('footnotes.update')
+ end
+
+ def destroy_footnote?
+ !archived? && organisation_match? && user.has_permission?('footnotes.destroy')
+ end
+
+ def update_footnote? ; edit_footnote? end
+ def new_footnote? ; create_footnote? end
+ end