Module: RailsKeycloakAuthorization::WithRoutesReader
- Extended by:
- ActiveSupport::Concern, WithRoutesReader
- Included in:
- ResourcesController, RoutesController, WithRoutesReader
- Defined in:
- app/controllers/concerns/rails_keycloak_authorization/with_routes_reader.rb
Instance Method Summary collapse
Instance Method Details
#available_route_names ⇒ Object
18 19 20 21 22 23 |
# File 'app/controllers/concerns/rails_keycloak_authorization/with_routes_reader.rb', line 18 def available_route_names names = Rails.application.routes.named_routes.names.filter do |route_name| route_name.present? && !%w[rails action_mailbox active_storage auth root].any? { |exclude| route_name.to_s.include?(exclude) } end names.uniq end |
#available_routes ⇒ Object
8 9 10 11 12 |
# File 'app/controllers/concerns/rails_keycloak_authorization/with_routes_reader.rb', line 8 def available_routes available_route_names.map do |name| Rails.application.routes.named_routes.get(name) end end |
#route(route_name) ⇒ Object
14 15 16 |
# File 'app/controllers/concerns/rails_keycloak_authorization/with_routes_reader.rb', line 14 def route(route_name) Rails.application.routes.named_routes[route_name] end |