policy update
This commit is contained in:
parent
fb5fb40944
commit
854b60bc8c
@ -21,13 +21,7 @@ class ReviewerVotePolicy < ApplicationPolicy
|
||||
user.acts_as_reviewer?
|
||||
end
|
||||
|
||||
def approve?
|
||||
return true if user.acts_as_admin?
|
||||
return false unless record.candidate.reviewers.include? user
|
||||
user.acts_as_manager?
|
||||
end
|
||||
|
||||
def decline?
|
||||
def interview_request?
|
||||
return true if user.acts_as_admin?
|
||||
return false unless record.candidate.reviewers.include? user
|
||||
user.acts_as_manager?
|
||||
|
@ -48,15 +48,7 @@ class ReviewerVotePolicyTest < PolicyAssertions::Test
|
||||
refute_permit users(:manager), reviewer_votes(:gustov)
|
||||
end
|
||||
|
||||
def approve
|
||||
assert_permit users(:manager), reviewer_votes(:manager_richard)
|
||||
assert_permit users(:admin), reviewer_votes(:manager_henry)
|
||||
|
||||
refute_permit users(:recruiter), reviewer_votes(:manager_henry)
|
||||
refute_permit users(:reviewer), reviewer_votes(:reviewer_richard)
|
||||
end
|
||||
|
||||
def decline
|
||||
def interview_request
|
||||
assert_permit users(:manager), reviewer_votes(:manager_richard)
|
||||
assert_permit users(:admin), reviewer_votes(:manager_henry)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user