mirror of
https://github.com/internetee/registry.git
synced 2025-07-22 02:35:57 +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
|
Loading…
Add table
Add a link
Reference in a new issue