Class: KeycloakRack::RoleMap

Inherits:
FlexibleStruct show all
Defined in:
lib/keycloak_rack/role_map.rb

Overview

PORO to interface with Keycloak roles.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#roles<String> (readonly)

Returns:

  • (<String>)

8
# File 'lib/keycloak_rack/role_map.rb', line 8

attribute :roles, Types::StringList

Instance Method Details

#has_role?(name) ⇒ Boolean

Parameters:

  • name (#to_s)

Returns:

  • (Boolean)

11
12
13
# File 'lib/keycloak_rack/role_map.rb', line 11

def has_role?(name)
  name.to_s.in? roles
end