mirror of
https://github.com/internetee/registry.git
synced 2025-07-02 17:23:34 +02:00
Add registrar dashboard #2713
This commit is contained in:
parent
ae29585ae2
commit
27f37b9ec4
11 changed files with 100 additions and 64 deletions
|
@ -17,15 +17,15 @@ class RegistrarController < ApplicationController
|
|||
sign_out(current_user)
|
||||
return
|
||||
end
|
||||
return if Rails.env.development?
|
||||
# return if Rails.env.development?
|
||||
registrar_ip_whitelisted = current_user.registrar.registrar_ip_white?(request.ip)
|
||||
|
||||
api_ip_whitelisted = true
|
||||
if current_user.can?(:create, :epp_request)
|
||||
api_ip_whitelisted = current_user.registrar.api_ip_white?(request.ip)
|
||||
end
|
||||
# api_ip_whitelisted = true
|
||||
# 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
|
||||
return if registrar_ip_whitelisted # && api_ip_whitelisted
|
||||
flash[:alert] = t('ip_is_not_whitelisted')
|
||||
sign_out(current_user)
|
||||
redirect_to registrar_login_path and return
|
||||
|
@ -37,4 +37,10 @@ class RegistrarController < ApplicationController
|
|||
def head_title_sufix
|
||||
t(:registrar_head_title_sufix)
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def current_ability
|
||||
@current_ability ||= Ability.new(current_user, request.remote_ip)
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue