Class: Authorization::DevelopmentSupport::Analyzer::GeneralRulesAnalyzer

Inherits:
Object
  • Object
show all
Defined in:
lib/declarative_authorization/development_support/analyzer.rb

Instance Method Summary collapse

Constructor Details

#initialize(analyzer) ⇒ GeneralRulesAnalyzer

Returns a new instance of GeneralRulesAnalyzer.



44
45
46
# File 'lib/declarative_authorization/development_support/analyzer.rb', line 44

def initialize(analyzer)
  @analyzer = analyzer
end

Instance Method Details

#analyzeObject



48
49
50
51
52
53
54
55
56
# File 'lib/declarative_authorization/development_support/analyzer.rb', line 48

def analyze
  mark(:policy, nil) if analyze_policy
  roles.select {|role| analyze_role(role) }.
      each { |role| mark(:role, role) }
  rules.select {|rule| analyze_rule(rule) }.
      each { |rule| mark(:rule, rule) }
  privileges.select {|privilege| !!analyze_privilege(privilege) }.
      each { |privilege| mark(:privilege, privilege) }
end