Class: Authorization::DevelopmentSupport::AnalyzerEngine::PrivilegesSet
- Inherits:
-
Set
- Object
- Set
- Authorization::DevelopmentSupport::AnalyzerEngine::PrivilegesSet
- Defined in:
- lib/declarative_authorization/development_support/development_support.rb
Instance Method Summary collapse
- #delete(privilege) ⇒ Object
- #include?(privilege) ⇒ Boolean
-
#initialize(*args) ⇒ PrivilegesSet
constructor
A new instance of PrivilegesSet.
- #intersects?(privileges) ⇒ Boolean
Constructor Details
#initialize(*args) ⇒ PrivilegesSet
Returns a new instance of PrivilegesSet.
209 210 211 212 213 214 215 |
# File 'lib/declarative_authorization/development_support/development_support.rb', line 209 def initialize (*args) if args.length > 2 @rule = args.shift @engine = args.shift end super(*args) end |
Instance Method Details
#delete(privilege) ⇒ Object
223 224 225 226 227 228 229 230 |
# File 'lib/declarative_authorization/development_support/development_support.rb', line 223 def delete (privilege) @rule.rule.privileges.delete(privilege.to_sym) if privilege.is_a?(Symbol) super(privilege_from_symbol(privilege)) else super end end |
#include?(privilege) ⇒ Boolean
216 217 218 219 220 221 222 |
# File 'lib/declarative_authorization/development_support/development_support.rb', line 216 def include? (privilege) if privilege.is_a?(Symbol) super(privilege_from_symbol(privilege)) else super end end |
#intersects?(privileges) ⇒ Boolean
232 233 234 |
# File 'lib/declarative_authorization/development_support/development_support.rb', line 232 def intersects? (privileges) intersection(privileges).length > 0 end |