mirror of
https://github.com/internetee/registry.git
synced 2025-08-13 04:59:42 +02:00
Cleanup #2713
This commit is contained in:
parent
27f37b9ec4
commit
f7906800c4
4 changed files with 2 additions and 44 deletions
|
@ -3,12 +3,10 @@ class Registrar::PollsController < Registrar::DeppController # EPP controller
|
||||||
before_action :init_epp_xml
|
before_action :init_epp_xml
|
||||||
|
|
||||||
def show
|
def show
|
||||||
# authorize! :view, :registrar_dashboard
|
|
||||||
@data = depp_current_user.request(@ex.poll)
|
@data = depp_current_user.request(@ex.poll)
|
||||||
end
|
end
|
||||||
|
|
||||||
def destroy
|
def destroy
|
||||||
# authorize! :delete, :registrar_poll
|
|
||||||
@data = depp_current_user.request(@ex.poll(poll: {
|
@data = depp_current_user.request(@ex.poll(poll: {
|
||||||
value: '', attrs: { op: 'ack', msgID: params[:id] }
|
value: '', attrs: { op: 'ack', msgID: params[:id] }
|
||||||
}))
|
}))
|
||||||
|
@ -35,7 +33,6 @@ class Registrar::PollsController < Registrar::DeppController # EPP controller
|
||||||
# end
|
# end
|
||||||
|
|
||||||
def confirm_transfer
|
def confirm_transfer
|
||||||
# authorize! :confirm, :transfer
|
|
||||||
domain_params = params[:domain]
|
domain_params = params[:domain]
|
||||||
@data = @domain.confirm_transfer(domain_params)
|
@data = @domain.confirm_transfer(domain_params)
|
||||||
|
|
||||||
|
|
|
@ -70,13 +70,6 @@ class Registrar::SessionsController < Devise::SessionsController
|
||||||
flash[:alert] = I18n.t(:ip_is_not_whitelisted)
|
flash[:alert] = I18n.t(:ip_is_not_whitelisted)
|
||||||
redirect_to :back and return
|
redirect_to :back and return
|
||||||
end
|
end
|
||||||
|
|
||||||
# if @api_user.can?(:create, :epp_login)
|
|
||||||
# unless @api_user.registrar.api_ip_white?(request.ip)
|
|
||||||
# flash[:alert] = I18n.t(:ip_is_not_whitelisted)
|
|
||||||
# redirect_to :back and return
|
|
||||||
# end
|
|
||||||
# end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
sign_in @api_user if @api_user.identity_code == current_user.identity_code
|
sign_in @api_user if @api_user.identity_code == current_user.identity_code
|
||||||
|
|
|
@ -9,29 +9,20 @@ class RegistrarController < ApplicationController
|
||||||
false
|
false
|
||||||
end
|
end
|
||||||
|
|
||||||
# rubocop:disable Metrics/PerceivedComplexity
|
|
||||||
# rubocop:disable Metrics/CyclomaticComplexity
|
|
||||||
def check_ip
|
def check_ip
|
||||||
return unless current_user
|
return unless current_user
|
||||||
unless current_user.is_a? ApiUser
|
unless current_user.is_a? ApiUser
|
||||||
sign_out(current_user)
|
sign_out(current_user)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
# return if Rails.env.development?
|
return if Rails.env.development?
|
||||||
registrar_ip_whitelisted = current_user.registrar.registrar_ip_white?(request.ip)
|
registrar_ip_whitelisted = current_user.registrar.registrar_ip_white?(request.ip)
|
||||||
|
|
||||||
# api_ip_whitelisted = true
|
return if registrar_ip_whitelisted
|
||||||
# if current_user.can?(:create, :epp_request)
|
|
||||||
# api_ip_whitelisted = current_user.registrar.api_ip_white?(request.ip)
|
|
||||||
# end
|
|
||||||
|
|
||||||
return if registrar_ip_whitelisted # && api_ip_whitelisted
|
|
||||||
flash[:alert] = t('ip_is_not_whitelisted')
|
flash[:alert] = t('ip_is_not_whitelisted')
|
||||||
sign_out(current_user)
|
sign_out(current_user)
|
||||||
redirect_to registrar_login_path and return
|
redirect_to registrar_login_path and return
|
||||||
end
|
end
|
||||||
# rubocop:enable Metrics/PerceivedComplexity
|
|
||||||
# rubocop:enable Metrics/CyclomaticComplexity
|
|
||||||
|
|
||||||
helper_method :head_title_sufix
|
helper_method :head_title_sufix
|
||||||
def head_title_sufix
|
def head_title_sufix
|
||||||
|
|
|
@ -30,21 +30,16 @@ class Ability
|
||||||
#
|
#
|
||||||
|
|
||||||
def super # Registrar/api_user dynamic role
|
def super # Registrar/api_user dynamic role
|
||||||
static_registrar
|
|
||||||
epp
|
epp
|
||||||
billing
|
billing
|
||||||
end
|
end
|
||||||
|
|
||||||
def epp # Registrar/api_user dynamic role
|
def epp # Registrar/api_user dynamic role
|
||||||
# static_registrar
|
|
||||||
can :view, :registrar_dashboard
|
can :view, :registrar_dashboard
|
||||||
|
|
||||||
if @user.registrar.api_ip_white?(@ip)
|
if @user.registrar.api_ip_white?(@ip)
|
||||||
can :manage, :poll
|
can :manage, :poll
|
||||||
can :manage, Depp::Contact
|
can :manage, Depp::Contact
|
||||||
# can :manage, Depp::Domain
|
|
||||||
# can :renew, Depp::Domain
|
|
||||||
# can :transfer, Depp::Domain
|
|
||||||
# can :manage, Depp::Keyrelay # TODO: Keyrelay is disabled for now
|
# can :manage, Depp::Keyrelay # TODO: Keyrelay is disabled for now
|
||||||
# can :confirm, :keyrelay # TODO: Keyrelay is disabled for now
|
# can :confirm, :keyrelay # TODO: Keyrelay is disabled for now
|
||||||
can :manage, :xml_console
|
can :manage, :xml_console
|
||||||
|
@ -84,7 +79,6 @@ class Ability
|
||||||
can(:manage, Invoice) { |i| i.buyer_id == @user.registrar_id }
|
can(:manage, Invoice) { |i| i.buyer_id == @user.registrar_id }
|
||||||
can :manage, :deposit
|
can :manage, :deposit
|
||||||
can :read, AccountActivity
|
can :read, AccountActivity
|
||||||
#can(:create, :epp_login) # billing can establis epp connection in order to login
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def customer_service # Admin/admin_user dynamic role
|
def customer_service # Admin/admin_user dynamic role
|
||||||
|
@ -122,23 +116,6 @@ class Ability
|
||||||
can :access, :settings_menu
|
can :access, :settings_menu
|
||||||
end
|
end
|
||||||
|
|
||||||
#
|
|
||||||
# Static roles, linked from dynamic roles
|
|
||||||
#
|
|
||||||
def static_registrar
|
|
||||||
#can :manage, Nameserver
|
|
||||||
# can :view, :registrar_dashboard
|
|
||||||
# can :delete, :registrar_poll
|
|
||||||
# can :manage, :registrar_xml_console
|
|
||||||
# can :manage, Depp::Contact
|
|
||||||
# can :manage, Depp::Domain
|
|
||||||
# can :renew, Depp::Domain
|
|
||||||
# can :transfer, Depp::Domain
|
|
||||||
# can :manage, Depp::Keyrelay
|
|
||||||
# can :confirm, :keyrelay
|
|
||||||
# can :confirm, :transfer
|
|
||||||
end
|
|
||||||
|
|
||||||
def static_registrant
|
def static_registrant
|
||||||
can :manage, :registrant_domains
|
can :manage, :registrant_domains
|
||||||
can :manage, :registrant_whois
|
can :manage, :registrant_whois
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue