Class: KeycloakAdmin::BaseRoleContainingResource

Inherits:
Object
  • Object
show all
Defined in:
lib/keycloak-admin/resource/base_role_containing_resource.rb

Direct Known Subclasses

GroupResource, UserResource

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(configuration, realm_client, resource_id) ⇒ BaseRoleContainingResource

Returns a new instance of BaseRoleContainingResource.

Raises:

  • (ArgumentError)


5
6
7
8
9
10
# File 'lib/keycloak-admin/resource/base_role_containing_resource.rb', line 5

def initialize(configuration, realm_client, resource_id)
  @configuration = configuration
  raise ArgumentError.new("realm must be defined") unless realm_client.name_defined?
  @realm_client = realm_client
  @resource_id = resource_id
end

Instance Attribute Details

#resource_idObject (readonly)

Returns the value of attribute resource_id.



3
4
5
# File 'lib/keycloak-admin/resource/base_role_containing_resource.rb', line 3

def resource_id
  @resource_id
end

Instance Method Details

#client_role_mappings(client_id) ⇒ Object



20
21
22
# File 'lib/keycloak-admin/resource/base_role_containing_resource.rb', line 20

def client_role_mappings(client_id)
  ClientRoleMappingsClient.new(@configuration, self, client_id)
end

#resource_urlObject



16
17
18
# File 'lib/keycloak-admin/resource/base_role_containing_resource.rb', line 16

def resource_url
  "#{@realm_client.realm_admin_url}/#{resources_name}/#{@resource_id}"
end

#resources_nameObject

Raises:

  • (NotImplementedError)


12
13
14
# File 'lib/keycloak-admin/resource/base_role_containing_resource.rb', line 12

def resources_name
  raise NotImplementedError.new("must override in subclass")
end

#role_mapperObject



24
25
26
# File 'lib/keycloak-admin/resource/base_role_containing_resource.rb', line 24

def role_mapper
  RoleMapperClient.new(@configuration, self)
end