aboutsummaryrefslogtreecommitdiffstats
path: root/app/policies/access_link_policy.rb
blob: a4f0e40e8914363a7cc4701cfd2110f3031d0e2e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
class AccessLinkPolicy < ApplicationPolicy
  class Scope < Scope
    def resolve
      scope
    end
  end

  def create?
    !archived? && oragnisation_mathc? && user.has_permission?('access_links.create')
  end

  def update?
    !archived? && organisation_match? && user.has_permission?('access_links.edit')
  end

  def destroy?
    !archived? && organisation_match? && user.has_permission?('access_links.destroy')
  end
end