BURs: allow only pending BURs to be rejected.

Fix it being possible to reject approved BURs, or to re-reject already
rejected BURs.

Rejecting an approved BUR wouldn't revert the aliases/implications, but
it would change the BUR's status to rejected.
This commit is contained in:
evazion
2019-01-15 21:07:48 -06:00
parent 971281949f
commit a284d3fb4a
2 changed files with 10 additions and 1 deletions

View File

@@ -181,6 +181,14 @@ class BulkUpdateRequest < ApplicationRecord
user_id == user.id || user.is_builder?
end
def approvable?(user)
!is_approved? && user.is_admin?
end
def rejectable?(user)
is_pending? && editable?(user)
end
def reason_with_link
"[bur:#{id}]\n\nReason: #{reason}"
end