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

  def destroy?
    organisation_match? && user.has_permission?('api_keys.destroy')
  end

  def create?
    user.has_permission?('api_keys.create')
  end

  def update?
    organisation_match? && user.has_permission?('api_keys.update')
  end
end