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

    def create?
      !archived? && organisation_match? && user.has_permission?('connection_links.create')
    end

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

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