Class: Authorization::DevelopmentSupport::Analyzer::InheritingPrivilegesAnalyzer

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

Instance Method Summary collapse

Methods inherited from GeneralRulesAnalyzer

#analyze, #initialize

Constructor Details

This class inherits a constructor from Authorization::DevelopmentSupport::Analyzer::GeneralRulesAnalyzer

Instance Method Details

#analyze_rule(rule) ⇒ Object



117
118
119
# File 'lib/declarative_authorization/development_support/analyzer.rb', line 117

def analyze_rule (rule)
  rule.privileges.any? {|privilege| rule.privileges.intersects?(privilege.ancestors) }
end

#message(object) ⇒ Object



121
122
123
# File 'lib/declarative_authorization/development_support/analyzer.rb', line 121

def message (object)
  "At least one privilege inherits from another in this rule."
end