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

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

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

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