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
24 def initialize(sid, mask, flags = 0, type = ACCESS_ALLOWED_ACE_TYPE)
25   @sid = sid
26   @mask = mask
27   @flags = flags
28   @type = type
29 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
75 def ==(other)
76   self.class == other.class &&
77     sid == other.sid &&
78     mask == other.mask &&
79     flags == other.flags &&
80     type == other.type
81 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
51 def container_inherit?
52   (@flags & CONTAINER_INHERIT_ACE) == CONTAINER_INHERIT_ACE
53 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
44 def inherit_only?
45   (@flags & INHERIT_ONLY_ACE) == INHERIT_ONLY_ACE
46 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
35 def inherited?
36   (@flags & INHERITED_ACE) == INHERITED_ACE
37 end
inspect() click to toggle source
   # File lib/puppet/util/windows/access_control_entry.rb
62 def inspect
63   inheritance = ""
64   inheritance << '(I)' if inherited?
65   inheritance << '(OI)' if object_inherit?
66   inheritance << '(CI)' if container_inherit?
67   inheritance << '(IO)' if inherit_only?
68 
69   left = "#{sid_to_name(sid)}:#{inheritance}"
70   left = left.ljust(45)
71   "#{left} 0x#{mask.to_s(16)}"
72 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
58 def object_inherit?
59   (@flags & OBJECT_INHERIT_ACE) == OBJECT_INHERIT_ACE
60 end