mirror of
https://github.com/internetee/registry.git
synced 2025-07-24 11:38:30 +02:00
Story#105842700 - Set security
This commit is contained in:
parent
438f77a981
commit
be8aa474f8
3 changed files with 21 additions and 9 deletions
|
@ -1,8 +1,18 @@
|
|||
class Registrant::ContactsController < RegistrantController
|
||||
|
||||
def show
|
||||
@contact = Contact.find(params[:id])
|
||||
@contact = contacts.find(params[:id])
|
||||
authorize! :read, @contact
|
||||
@contact.valid?
|
||||
end
|
||||
|
||||
def contacts
|
||||
ident_cc, ident = @current_user.registrant_ident.to_s.split '-'
|
||||
begin
|
||||
BusinessRegistryCache.fetch_by_ident_and_cc(ident, ident_cc).associated_contacts
|
||||
rescue Soap::Arireg::NotAvailableError => error
|
||||
flash[:notice] = I18n.t(error.json[:message])
|
||||
Rails.logger.fatal("[EXCEPTION] #{error.to_s}")
|
||||
Contact.none
|
||||
end
|
||||
end
|
||||
end
|
|
@ -11,15 +11,12 @@ class Registrant::DomainsController < RegistrantController
|
|||
end
|
||||
|
||||
def show
|
||||
@domain = Domain.find(params[:id])
|
||||
if !(domains.include?(@domain) || @domain.valid?)
|
||||
redirect_to registrant_domains_path
|
||||
end
|
||||
@domain = domains.find(params[:id])
|
||||
authorize! :read, @domain
|
||||
end
|
||||
|
||||
def set_domain
|
||||
@domain = Domain.find(params[:id])
|
||||
@domain = domains.find(params[:id])
|
||||
end
|
||||
|
||||
def download_list
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue