mirror of
https://github.com/internetee/registry.git
synced 2025-05-17 17:59:47 +02:00
Check API whitelist IP-s when loggin into registrar with pw #2713
This commit is contained in:
parent
8bffdbf783
commit
d26dd3da98
5 changed files with 38 additions and 17 deletions
|
@ -24,6 +24,9 @@ class ApiUser < User
|
|||
|
||||
attr_accessor :registrar_typeahead
|
||||
|
||||
SUPER = 'super'
|
||||
EPP = 'epp'
|
||||
|
||||
ROLES = %w(super epp billing) # should not match to admin roles
|
||||
|
||||
def ability
|
||||
|
@ -41,6 +44,10 @@ class ApiUser < User
|
|||
@registrar_typeahead || registrar || nil
|
||||
end
|
||||
|
||||
def can_make_api_calls?
|
||||
([SUPER, EPP] & roles).any?
|
||||
end
|
||||
|
||||
def to_s
|
||||
username
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue