class Puppet::Util::Windows::AccessControlEntry

Windows Access Control Entry

Represents an access control entry, which grants or denies a subject, identified by a SID, rights to a securable object.

@see msdn.microsoft.com/en-us/library/windows/desktop/aa374868(v=vs.85).aspx @api private

Constants

ACCESS_ALLOWED_ACE_TYPE
ACCESS_DENIED_ACE_TYPE
CONTAINER_INHERIT_ACE
INHERITED_ACE
INHERIT_ONLY_ACE
NO_PROPAGATE_INHERIT_ACE
OBJECT_INHERIT_ACE

Attributes

flags[R]
mask[R]
sid[RW]
type[R]

Public Class Methods

new(sid, mask, flags = 0, type = ACCESS_ALLOWED_ACE_TYPE) click to toggle source
   # File lib/puppet/util/windows/access_control_entry.rb
25 def initialize(sid, mask, flags = 0, type = ACCESS_ALLOWED_ACE_TYPE)
26   @sid = sid
27   @mask = mask
28   @flags = flags
29   @type = type
30 end

Public Instance Methods

==(other) click to toggle source

Returns true if this ACE is equal to other

   # File lib/puppet/util/windows/access_control_entry.rb
76 def ==(other)
77   self.class == other.class &&
78     sid == other.sid &&
79     mask == other.mask &&
80     flags == other.flags &&
81     type == other.type
82 end
Also aliased as: eql?
container_inherit?() click to toggle source

Returns true if this ACE applies to child directories.

@return [Boolean] true if the ACE applies to child directories

   # File lib/puppet/util/windows/access_control_entry.rb
52 def container_inherit?
53   (@flags & CONTAINER_INHERIT_ACE) == CONTAINER_INHERIT_ACE
54 end
eql?(other)
Alias for: ==
inherit_only?() click to toggle source

Returns true if this ACE only applies to children of the object. If false, it applies to the object.

@return [Boolean] true if the ACE only applies to children and not the object itself.

   # File lib/puppet/util/windows/access_control_entry.rb
45 def inherit_only?
46   (@flags & INHERIT_ONLY_ACE) == INHERIT_ONLY_ACE
47 end
inherited?() click to toggle source

Returns true if this ACE is inherited from a parent. If false, then the ACE is set directly on the object to which it refers.

@return [Boolean] true if the ACE is inherited

   # File lib/puppet/util/windows/access_control_entry.rb
36 def inherited?
37   (@flags & INHERITED_ACE) == INHERITED_ACE
38 end
inspect() click to toggle source
   # File lib/puppet/util/windows/access_control_entry.rb
63 def inspect
64   inheritance = String.new
65   inheritance << '(I)' if inherited?
66   inheritance << '(OI)' if object_inherit?
67   inheritance << '(CI)' if container_inherit?
68   inheritance << '(IO)' if inherit_only?
69 
70   left = "#{sid_to_name(sid)}:#{inheritance}"
71   left = left.ljust(45)
72   "#{left} 0x#{mask.to_s(16)}"
73 end
object_inherit?() click to toggle source

Returns true if this ACE applies to child files.

@return [Boolean] true if the ACE applies to child files.

   # File lib/puppet/util/windows/access_control_entry.rb
59 def object_inherit?
60   (@flags & OBJECT_INHERIT_ACE) == OBJECT_INHERIT_ACE
61 end