Class: WebConsole::Request

Inherits:
ActionDispatch::Request
  • Object
show all
Defined in:
lib/web_console/request.rb

Defined Under Namespace

Classes: GetSecureIp

Instance Method Summary collapse

Instance Method Details

#permitted?Boolean

Returns:

  • (Boolean)


7
8
9
# File 'lib/web_console/request.rb', line 7

def permitted?
  permissions.include?(strict_remote_ip)
end

#strict_remote_ipObject



11
12
13
14
15
# File 'lib/web_console/request.rb', line 11

def strict_remote_ip
  GetSecureIp.new(self, permissions).to_s
rescue ActionDispatch::RemoteIp::IpSpoofAttackError
  "[Spoofed]"
end