Class: Chef::ReservedNames::Win32::Security::SecurityDescriptor

Inherits:
Object
  • Object
show all
Defined in:
lib/chef/win32/security/security_descriptor.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(pointer) ⇒ SecurityDescriptor

Returns a new instance of SecurityDescriptor.



28
29
30
# File 'lib/chef/win32/security/security_descriptor.rb', line 28

def initialize(pointer)
  @pointer = pointer
end

Instance Attribute Details

#pointerObject (readonly)

Returns the value of attribute pointer.



32
33
34
# File 'lib/chef/win32/security/security_descriptor.rb', line 32

def pointer
  @pointer
end

Instance Method Details

#absolute?Boolean

Returns:

  • (Boolean)


34
35
36
# File 'lib/chef/win32/security/security_descriptor.rb', line 34

def absolute?
  !self_relative?
end

#controlObject



38
39
40
41
# File 'lib/chef/win32/security/security_descriptor.rb', line 38

def control
  control, version = Chef::ReservedNames::Win32::Security.get_security_descriptor_control(self)
  control
end

#daclObject



43
44
45
46
47
# File 'lib/chef/win32/security/security_descriptor.rb', line 43

def dacl
  raise "DACL not present" if !dacl_present?
  present, acl, defaulted = Chef::ReservedNames::Win32::Security.get_security_descriptor_dacl(self)
  acl
end

#dacl_inherits?Boolean

Returns:

  • (Boolean)


49
50
51
# File 'lib/chef/win32/security/security_descriptor.rb', line 49

def dacl_inherits?
  (control & Chef::ReservedNames::Win32::API::Security::SE_DACL_PROTECTED) == 0
end

#dacl_present?Boolean

Returns:

  • (Boolean)


53
54
55
# File 'lib/chef/win32/security/security_descriptor.rb', line 53

def dacl_present?
  (control & Chef::ReservedNames::Win32::API::Security::SE_DACL_PRESENT) != 0
end

#groupObject



57
58
59
60
# File 'lib/chef/win32/security/security_descriptor.rb', line 57

def group
  result, defaulted = Chef::ReservedNames::Win32::Security.get_security_descriptor_group(self)
  result
end

#ownerObject



62
63
64
65
# File 'lib/chef/win32/security/security_descriptor.rb', line 62

def owner
  result, defaulted = Chef::ReservedNames::Win32::Security.get_security_descriptor_owner(self)
  result
end

#saclObject



67
68
69
70
71
72
73
# File 'lib/chef/win32/security/security_descriptor.rb', line 67

def sacl
  raise "SACL not present" if !sacl_present?
  Security.with_privileges("SeSecurityPrivilege") do
    present, acl, defaulted = Chef::ReservedNames::Win32::Security.get_security_descriptor_sacl(self)
    acl
  end
end

#sacl_inherits?Boolean

Returns:

  • (Boolean)


75
76
77
# File 'lib/chef/win32/security/security_descriptor.rb', line 75

def sacl_inherits?
  (control & Chef::ReservedNames::Win32::API::Security::SE_SACL_PROTECTED) == 0
end

#sacl_present?Boolean

Returns:

  • (Boolean)


79
80
81
# File 'lib/chef/win32/security/security_descriptor.rb', line 79

def sacl_present?
  (control & Chef::ReservedNames::Win32::API::Security::SE_SACL_PRESENT) != 0
end

#self_relative?Boolean

Returns:

  • (Boolean)


83
84
85
# File 'lib/chef/win32/security/security_descriptor.rb', line 83

def self_relative?
  (control & Chef::ReservedNames::Win32::API::Security::SE_SELF_RELATIVE) != 0
end

#valid?Boolean

Returns:

  • (Boolean)


87
88
89
# File 'lib/chef/win32/security/security_descriptor.rb', line 87

def valid?
  Chef::ReservedNames::Win32::Security.is_valid_security_descriptor(self)
end