Class: ActiveElement::PermissionsReport

Inherits:
Object
  • Object
show all
Includes:
Paintbrush
Defined in:
lib/active_element/permissions_report.rb

Overview

Generates a report of all permissions used by a given application. Used by ‘rake active_element:permissions` to provide a convenient interface to listing all required permissions so that they can be provisioned to users as needed.

Constant Summary collapse

COLOR_MAP =
{ list: :cyan, view: :blue, create: :green, delete: :red, edit: :yellow, text: :white }.freeze

Instance Method Summary collapse

Constructor Details

#initializePermissionsReport

Returns a new instance of PermissionsReport.



12
13
14
15
16
# File 'lib/active_element/permissions_report.rb', line 12

def initialize
  ActiveElement.eager_load_controllers
  ActiveElement.eager_load_models
  @buffer = []
end

Instance Method Details

#reportObject



18
19
20
21
# File 'lib/active_element/permissions_report.rb', line 18

def report
  generate
  buffer.join("\n")
end