Class: Authorization::DevelopmentSupport::Analyzer::GeneralRulesAnalyzer
- Inherits:
-
Object
- Object
- Authorization::DevelopmentSupport::Analyzer::GeneralRulesAnalyzer
- Defined in:
- lib/declarative_authorization/development_support/analyzer.rb
Direct Known Subclasses
InheritingPrivilegesAnalyzer, ProposedPrivilegeHierarchyAnalyzer, RoleExplosionAnalyzer
Instance Method Summary collapse
- #analyze ⇒ Object
-
#initialize(analyzer) ⇒ GeneralRulesAnalyzer
constructor
A new instance of GeneralRulesAnalyzer.
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
#analyze ⇒ Object
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 |