mirror of
https://github.com/internetee/registry.git
synced 2025-07-28 21:46:24 +02:00
Added missing abilities to xml_console and contacts controllers
This commit is contained in:
parent
e971638938
commit
e7a976ce89
3 changed files with 7 additions and 0 deletions
|
@ -6,6 +6,7 @@ module EppRequestable
|
|||
end
|
||||
|
||||
def create
|
||||
authorize! :create, Epp::Server
|
||||
result = server.request(request_params[:payload])
|
||||
render_success(data: { xml: result.force_encoding('UTF-8') })
|
||||
rescue StandardError
|
||||
|
|
|
@ -74,6 +74,7 @@ module Repp
|
|||
api :POST, '/repp/v1/contacts'
|
||||
desc 'Create a new contact'
|
||||
def create
|
||||
authorize! :create, Epp::Contact
|
||||
@contact = Epp::Contact.new(contact_params_with_address, current_user.registrar, epp: false)
|
||||
action = Actions::ContactCreate.new(@contact, contact_params[:legal_document],
|
||||
contact_ident_params)
|
||||
|
@ -89,6 +90,7 @@ module Repp
|
|||
api :PUT, '/repp/v1/contacts/:contact_code'
|
||||
desc 'Update existing contact'
|
||||
def update
|
||||
authorize! :update, Epp::Contact
|
||||
action = Actions::ContactUpdate.new(@contact, contact_params_with_address(required: false),
|
||||
contact_params[:legal_document],
|
||||
contact_ident_params(required: false), current_user)
|
||||
|
@ -104,6 +106,7 @@ module Repp
|
|||
api :DELETE, '/repp/v1/contacts/:contact_code'
|
||||
desc 'Delete a specific contact'
|
||||
def destroy
|
||||
authorize! :delete, Epp::Contact
|
||||
action = Actions::ContactDelete.new(@contact, params[:legal_document])
|
||||
unless action.call
|
||||
handle_errors(@contact)
|
||||
|
|
|
@ -33,6 +33,9 @@ class Ability
|
|||
def epp # Registrar/api_user dynamic role
|
||||
can :manage, Account
|
||||
|
||||
# Epp::Server
|
||||
can :create, Epp::Server
|
||||
|
||||
# Poll
|
||||
can :manage, :poll
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue