blob: 75143a8bd42760dcf57535032b33c4c2fe4d9b4d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
class PurchaseWindowPolicy < ApplicationPolicy
class Scope < Scope
def resolve
scope
end
end
def create?
!archived? && organisation_match? && user.has_permission?('purchase_windows.create')
end
def update?
!archived? && organisation_match? && user.has_permission?('purchase_windows.update')
end
def destroy?
!archived? && organisation_match? && user.has_permission?('purchase_windows.destroy')
end
end
|