2022-02-15 07:27:53 +11:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
class AppealPolicy < ApplicationPolicy
|
|
|
|
def index?
|
2022-07-05 10:41:40 +10:00
|
|
|
role.can?(:manage_appeals)
|
2022-02-15 07:27:53 +11:00
|
|
|
end
|
|
|
|
|
|
|
|
def approve?
|
2022-07-05 10:41:40 +10:00
|
|
|
record.pending? && role.can?(:manage_appeals)
|
2022-02-15 07:27:53 +11:00
|
|
|
end
|
|
|
|
|
2022-07-05 10:41:40 +10:00
|
|
|
def reject?
|
|
|
|
record.pending? && role.can?(:manage_appeals)
|
|
|
|
end
|
2022-02-15 07:27:53 +11:00
|
|
|
end
|