Class: Admin::BaseController

Inherits:
ActionController::Base
  • Object
show all
Includes:
Pagination
Defined in:
lib/generators/open_loam/install/templates/admin/base_controller.rb

Constant Summary

Constants included from Pagination

Pagination::PER_PAGE

Class Method Summary collapse

Methods included from Pagination

#paginate

Class Method Details

.skip_authorization!(reason, **options) ⇒ Object

For screens that are authorized STRUCTURALLY rather than by a policy call — a list scoped to current_actor, a pre-auth screen. The reason is required and shows up in the source, so every exemption is a documented claim rather than a silent opt-out.

Raises:

  • (ArgumentError)


24
25
26
27
28
# File 'lib/generators/open_loam/install/templates/admin/base_controller.rb', line 24

def self.skip_authorization!(reason, **options)
  raise ArgumentError, "skip_authorization! needs a reason" if reason.to_s.strip.empty?

  skip_after_action :verify_authorized!, **options
end