blob: 7dccd30a9815300203029fc4a5e9cf7764800dc0 (
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?
    user.has_permission?('connection_links.create') # organisation match via referential is checked in the view
  end
  def destroy?
    organisation_match? && user.has_permission?('connection_links.destroy')
  end
  def update?
    organisation_match? && user.has_permission?('connection_links.edit')
  end
end
  |