mirror of
https://github.com/internetee/registry.git
synced 2025-08-03 16:32:04 +02:00
Added Registrar roles with super, epp, billing
This commit is contained in:
parent
8371dcf46e
commit
5afa0ac793
12 changed files with 77 additions and 24 deletions
|
@ -55,6 +55,8 @@ class Admin::ApiUsersController < AdminController
|
|||
end
|
||||
|
||||
def api_user_params
|
||||
params.require(:api_user).permit(:username, :password, :active, :registrar_id, :registrar_typeahead, :identity_code)
|
||||
params.require(:api_user).permit(:username, :password, :active,
|
||||
:registrar_id, :registrar_typeahead,
|
||||
:identity_code, { roles: [] })
|
||||
end
|
||||
end
|
||||
|
|
|
@ -145,6 +145,7 @@ class Registrar::SessionsController < Devise::SessionsController
|
|||
private
|
||||
|
||||
def check_ip
|
||||
return if Rails.env.development?
|
||||
return if WhiteIp.registrar_ip_white?(request.ip)
|
||||
render text: t('ip_is_not_whitelisted') and return
|
||||
end
|
||||
|
|
|
@ -12,6 +12,11 @@ class RegistrarController < ApplicationController
|
|||
|
||||
def check_ip
|
||||
return unless current_user
|
||||
unless current_user.is_a? ApiUser
|
||||
sign_out(current_user)
|
||||
return
|
||||
end
|
||||
|
||||
return if current_user.registrar.registrar_ip_white?(request.ip)
|
||||
flash[:alert] = t('ip_is_not_whitelisted')
|
||||
sign_out(current_user)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue