Class: Chef::ReservedNames::Win32::Security::SecurityDescriptor
- Inherits:
-
Object
- Object
- 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 48 |
# File 'lib/chef/win32/security/security_descriptor.rb', line 43 def dacl raise "DACL not present" unless dacl_present? present, acl, defaulted = Chef::ReservedNames::Win32::Security.get_security_descriptor_dacl(self) acl end |
#dacl_inherits? ⇒ Boolean
50 51 52 |
# File 'lib/chef/win32/security/security_descriptor.rb', line 50 def dacl_inherits? (control & Chef::ReservedNames::Win32::API::Security::SE_DACL_PROTECTED) == 0 end |
#dacl_present? ⇒ Boolean
54 55 56 |
# File 'lib/chef/win32/security/security_descriptor.rb', line 54 def dacl_present? (control & Chef::ReservedNames::Win32::API::Security::SE_DACL_PRESENT) != 0 end |
#group ⇒ Object
58 59 60 61 |
# File 'lib/chef/win32/security/security_descriptor.rb', line 58 def group result, defaulted = Chef::ReservedNames::Win32::Security.get_security_descriptor_group(self) result end |
#owner ⇒ Object
63 64 65 66 |
# File 'lib/chef/win32/security/security_descriptor.rb', line 63 def owner result, defaulted = Chef::ReservedNames::Win32::Security.get_security_descriptor_owner(self) result end |
#sacl ⇒ Object
68 69 70 71 72 73 74 75 |
# File 'lib/chef/win32/security/security_descriptor.rb', line 68 def sacl raise "SACL not present" unless 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
77 78 79 |
# File 'lib/chef/win32/security/security_descriptor.rb', line 77 def sacl_inherits? (control & Chef::ReservedNames::Win32::API::Security::SE_SACL_PROTECTED) == 0 end |
#sacl_present? ⇒ Boolean
81 82 83 |
# File 'lib/chef/win32/security/security_descriptor.rb', line 81 def sacl_present? (control & Chef::ReservedNames::Win32::API::Security::SE_SACL_PRESENT) != 0 end |
#self_relative? ⇒ Boolean
85 86 87 |
# File 'lib/chef/win32/security/security_descriptor.rb', line 85 def self_relative? (control & Chef::ReservedNames::Win32::API::Security::SE_SELF_RELATIVE) != 0 end |
#valid? ⇒ Boolean
89 90 91 |
# File 'lib/chef/win32/security/security_descriptor.rb', line 89 def valid? Chef::ReservedNames::Win32::Security.is_valid_security_descriptor(self) end |