aboutsummaryrefslogtreecommitdiffstats
path: root/app/policies/line_policy.rb
blob: acb0d79e7713c1de8d8af8569b75f88b91d83d1d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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