mirror of
https://github.com/internetee/registry.git
synced 2025-07-24 19:48:28 +02:00
Merge pull request #1747 from internetee/1745-hide-contact-name-on-contact-info
EPP: Hide name from contactInfo if no auth provided
This commit is contained in:
commit
678514dcbf
4 changed files with 9 additions and 4 deletions
|
@ -14,7 +14,11 @@ xml.epp_head do
|
|||
end
|
||||
|
||||
xml.tag!('contact:postalInfo', type: 'int') do
|
||||
xml.tag!('contact:name', @contact.name)
|
||||
if can? :view_full_info, @contact, @password
|
||||
xml.tag!('contact:name', @contact.name)
|
||||
else
|
||||
xml.tag!('contact:name', 'No access')
|
||||
end
|
||||
if can? :view_full_info, @contact, @password
|
||||
xml.tag!('contact:org', @contact.org_name) if @contact.org_name.present?
|
||||
|
||||
|
|
|
@ -13,5 +13,5 @@
|
|||
- registrant = Contact.find_by_code(x.text)
|
||||
%tr
|
||||
%td= x['type']
|
||||
%td= registrant.name
|
||||
%td= registrant.registrar == current_registrar_user.registrar ? registrant.name : 'N/A'
|
||||
%td= x.text
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
|
||||
<% registrant = Contact.find_by_code(@data.css('registrant').text) %>
|
||||
<dt><%= t('.registrant') %></dt>
|
||||
<dd><%= "#{registrant.name} (#{@data.css('registrant').text})" %></dd>
|
||||
<dd><%= registrant.registrar == current_registrar_user.registrar ? "#{registrant.name} (#{@data.css('registrant').text})" : @data.css('registrant').text %></dd>
|
||||
|
||||
<dt><%= t('.registered') %></dt>
|
||||
<dd><%= @data.css('crDate').text %></dd>
|
||||
|
|
|
@ -44,7 +44,7 @@ class EppContactInfoBaseTest < EppTestCase
|
|||
contact: xml_schema).text
|
||||
end
|
||||
|
||||
def test_hides_password_when_current_registrar_is_not_sponsoring
|
||||
def test_hides_password_and_name_when_current_registrar_is_not_sponsoring
|
||||
non_sponsoring_registrar = registrars(:goodnames)
|
||||
@contact.update!(registrar: non_sponsoring_registrar)
|
||||
|
||||
|
@ -70,6 +70,7 @@ class EppContactInfoBaseTest < EppTestCase
|
|||
assert_epp_response :completed_successfully
|
||||
response_xml = Nokogiri::XML(response.body)
|
||||
assert_nil response_xml.at_xpath('//contact:authInfo', contact: xml_schema)
|
||||
assert_equal 'No access', response_xml.at_xpath('//contact:name', contact: xml_schema).text
|
||||
end
|
||||
|
||||
private
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue