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
Returns true if this ACE is equal to other
# File lib/puppet/util/windows/access_control_entry.rb, line 75 def ==(other) self.class == other.class && sid == other.sid && mask == other.mask && flags == other.flags && type == other.type end
Returns true if this ACE applies to child directories.
@return [Boolean] true if the ACE applies to child direcories
# File lib/puppet/util/windows/access_control_entry.rb, line 51 def container_inherit? (@flags & CONTAINER_INHERIT_ACE) == CONTAINER_INHERIT_ACE end
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, line 44 def inherit_only? (@flags & INHERIT_ONLY_ACE) == INHERIT_ONLY_ACE end
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, line 35 def inherited? (@flags & INHERITED_ACE) == INHERITED_ACE end
# File lib/puppet/util/windows/access_control_entry.rb, line 62 def inspect inheritance = "" inheritance << '(I)' if inherited? inheritance << '(OI)' if object_inherit? inheritance << '(CI)' if container_inherit? inheritance << '(IO)' if inherit_only? left = "#{sid_to_name(sid)}:#{inheritance}" left = left.ljust(45) "#{left} 0x#{mask.to_s(16)}" end
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, line 58 def object_inherit? (@flags & OBJECT_INHERIT_ACE) == OBJECT_INHERIT_ACE end
# File lib/puppet/util/windows/access_control_entry.rb, line 24 def initialize(sid, mask, flags = 0, type = ACCESS_ALLOWED_ACE_TYPE) @sid = sid @mask = mask @flags = flags @type = type end