class Authorization::DevelopmentSupport::Analyzer::RoleExplosionAnalyzer
Constants
- SMALL_ROLES_RATIO
- SMALL_ROLE_RULES_COUNT
Public Instance Methods
analyze_policy()
click to toggle source
# File lib/declarative_authorization/development_support/analyzer.rb, line 102 def analyze_policy small_roles.length > 1 and small_roles.length.to_f / roles.length.to_f > SMALL_ROLES_RATIO end
message(object)
click to toggle source
# File lib/declarative_authorization/development_support/analyzer.rb, line 106 def message (object) "The ratio of small roles is quite high (> %.0f%%). Consider refactoring." % (SMALL_ROLES_RATIO * 100) end
Private Instance Methods
small_roles()
click to toggle source
# File lib/declarative_authorization/development_support/analyzer.rb, line 111 def small_roles roles.select {|role| role.rules.length < SMALL_ROLE_RULES_COUNT } end