Class: RailsKeycloakAuthorization::PoliciesController

Inherits:
ApplicationController show all
Includes:
ResourcesHelper, WithHtmxLayout, WithKeycloakAdmin
Defined in:
app/controllers/rails_keycloak_authorization/policies_controller.rb

Instance Method Summary collapse

Methods included from WithKeycloakAdmin

#realm_name

Instance Method Details

#createObject



14
15
16
17
# File 'app/controllers/rails_keycloak_authorization/policies_controller.rb', line 14

def create
  KeycloakAdminRubyAgent.create_keycloak_policy(params[:keycloak_realm_role_id], params[:keycloak_policy_name])
  redirect_to policies_path
end

#indexObject



8
9
10
11
12
# File 'app/controllers/rails_keycloak_authorization/policies_controller.rb', line 8

def index
  @default_policy_name = KeycloakAdminRubyAgent.policy_name
  @policies = KeycloakAdminRubyAgent.list_keycloak_policies
  @realm_roles = KeycloakAdminRubyAgent.list_roles
end