Class: Rabarber::Core::PermissionsIntegrityChecker

Inherits:
Object
  • Object
show all
Defined in:
lib/rabarber/core/permissions_integrity_checker.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(controller = nil) ⇒ PermissionsIntegrityChecker

Returns a new instance of PermissionsIntegrityChecker.



8
9
10
# File 'lib/rabarber/core/permissions_integrity_checker.rb', line 8

def initialize(controller = nil)
  @controller = controller
end

Instance Attribute Details

#controllerObject (readonly)

Returns the value of attribute controller.



6
7
8
# File 'lib/rabarber/core/permissions_integrity_checker.rb', line 6

def controller
  @controller
end

Instance Method Details

#run!Object

Raises:



12
13
14
15
16
17
18
19
# File 'lib/rabarber/core/permissions_integrity_checker.rb', line 12

def run!
  return if missing_list.empty?

  raise(
    Rabarber::Error,
    "Following actions were passed to 'grant_access' method but are not defined in the controller: #{missing_list}"
  )
end