diff --git a/lib/authority_only_response_gatekeeper.rb b/lib/authority_only_response_gatekeeper.rb index 56cdb092..1c3bcb87 100644 --- a/lib/authority_only_response_gatekeeper.rb +++ b/lib/authority_only_response_gatekeeper.rb @@ -3,11 +3,11 @@ module AuthorityOnlyResponseGatekeeper { public_body_id: 27, email: 'no-reply@cabinetoffice.ecase.co.uk' } ] - def calculate_allow_reason(info_request, mail) + def allow?(mail) public_body_id = info_request.public_body_id email = MailHandler.get_from_address(mail) - return [true, nil] if EXTRA_ALLOWED_EMAILS.any? do |a| + return true if EXTRA_ALLOWED_EMAILS.any? do |a| a[:public_body_id] == public_body_id && a[:email] == email end