Module: Verikloak::Pundit::Controller::ViewHelpers

Defined in:
lib/verikloak/pundit/controller.rb

Overview

View-facing helpers registered on helper-capable controllers.

Exposure is decided at call time (not include time) so that expose_helper_method set in config/initializers is honored even when ActionController loads before application initializers run.

Instance Method Summary collapse

Instance Method Details

#verikloak_claimsHash?

Access raw Verikloak claims from the controller, or nil when exposure to views is disabled via configuration.

Returns:

  • (Hash, nil)


17
18
19
20
21
# File 'lib/verikloak/pundit/controller.rb', line 17

def verikloak_claims
  return nil unless Verikloak::Pundit.config.expose_helper_method

  controller&.verikloak_claims
end