Class: Verifica::AclBuilder
- Inherits:
-
Object
- Object
- Verifica::AclBuilder
- Defined in:
- lib/verifica/acl_builder.rb
Overview
Builder that holds mutable list of Access Control Entries and methods to add new entries
Instance Method Summary collapse
-
#allow(sid, actions) ⇒ self
Add Access Control Entries that allow particular actions for the given Security Identifier.
-
#build ⇒ Acl
A new, immutable Access Control List.
-
#deny(sid, actions) ⇒ self
Add Access Control Entries that deny particular actions for the given Security Identifier.
-
#initialize(initial_aces = EMPTY_ARRAY) ⇒ AclBuilder
constructor
A new instance of AclBuilder.
Constructor Details
#initialize(initial_aces = EMPTY_ARRAY) ⇒ AclBuilder
Note:
Use Verifica::Acl.build or Verifica::Acl#build instead of this constructor directly
Returns a new instance of AclBuilder.
13 14 15 16 |
# File 'lib/verifica/acl_builder.rb', line 13 def initialize(initial_aces = EMPTY_ARRAY) @aces = initial_aces.dup freeze end |
Instance Method Details
#allow(sid, actions) ⇒ self
Add Access Control Entries that allow particular actions for the given Security Identifier
32 33 34 35 |
# File 'lib/verifica/acl_builder.rb', line 32 def allow(sid, actions) @aces.concat(actions.map { |action| Ace.new(sid, action, true) }) self end |