Class: Chef::ReservedNames::Win32::Security::SecurityDescriptor
- Defined in:
- lib/chef/win32/security/security_descriptor.rb
Instance Attribute Summary collapse
-
#pointer ⇒ Object
readonly
Returns the value of attribute pointer.
Instance Method Summary collapse
- #absolute? ⇒ Boolean
- #control ⇒ Object
- #dacl ⇒ Object
- #dacl_inherits? ⇒ Boolean
- #dacl_present? ⇒ Boolean
- #group ⇒ Object
-
#initialize(pointer) ⇒ SecurityDescriptor
constructor
A new instance of SecurityDescriptor.
- #owner ⇒ Object
- #sacl ⇒ Object
- #sacl_inherits? ⇒ Boolean
- #sacl_present? ⇒ Boolean
- #self_relative? ⇒ Boolean
- #valid? ⇒ Boolean
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
#pointer ⇒ Object (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
34 35 36 |
# File 'lib/chef/win32/security/security_descriptor.rb', line 34 def absolute? !self_relative? end |
#control ⇒ Object
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 |
#dacl ⇒ Object
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
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
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 |
#group ⇒ Object
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 |
#owner ⇒ Object
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 |
#sacl ⇒ Object
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
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
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
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
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 |