mirror of
https://github.com/internetee/registry.git
synced 2025-07-24 11:38:30 +02:00
Do not show contact if given domain does not belong to the current user
This commit is contained in:
parent
5a466206bf
commit
c89cce6287
7 changed files with 39 additions and 7 deletions
|
@ -29,6 +29,17 @@ class Registrant::ContactsController < RegistrantController
|
|||
end
|
||||
|
||||
def domain
|
||||
Domain.find(params[:domain_id])
|
||||
current_user_domains.find(params[:domain_id])
|
||||
end
|
||||
end
|
||||
|
||||
def current_user_domains
|
||||
ident_cc, ident = @current_user.registrant_ident.split '-'
|
||||
begin
|
||||
BusinessRegistryCache.fetch_associated_domains ident, ident_cc
|
||||
rescue Soap::Arireg::NotAvailableError => error
|
||||
flash[:notice] = I18n.t(error.json[:message])
|
||||
Rails.logger.fatal("[EXCEPTION] #{error.to_s}")
|
||||
current_user.domains
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue