Class: SecurityDescriptor
- Inherits:
-
Object
- Object
- SecurityDescriptor
- Defined in:
- lib/puppet/provider/fileshare/wmi/securitydescriptor.rb
Instance Attribute Summary collapse
-
#sid ⇒ Object
Returns the value of attribute sid.
-
#username ⇒ Object
Returns the value of attribute username.
Instance Method Summary collapse
-
#initialize ⇒ SecurityDescriptor
constructor
A new instance of SecurityDescriptor.
- #sd ⇒ Object
- #trustee ⇒ Object
Constructor Details
#initialize ⇒ SecurityDescriptor
Returns a new instance of SecurityDescriptor.
7 8 9 |
# File 'lib/puppet/provider/fileshare/wmi/securitydescriptor.rb', line 7 def initialize @wmi_session = WIN32OLE.connect("winmgmts://localhost/root/cimv2") end |
Instance Attribute Details
#sid ⇒ Object
Returns the value of attribute sid.
5 6 7 |
# File 'lib/puppet/provider/fileshare/wmi/securitydescriptor.rb', line 5 def sid @sid end |
#username ⇒ Object
Returns the value of attribute username.
5 6 7 |
# File 'lib/puppet/provider/fileshare/wmi/securitydescriptor.rb', line 5 def username @username end |
Instance Method Details
#sd ⇒ Object
18 19 20 21 22 23 |
# File 'lib/puppet/provider/fileshare/wmi/securitydescriptor.rb', line 18 def sd sd = @wmi_session.get("Win32_SecurityDescriptor").spawninstance_ sd.controlflags = 4 sd.owner = trustee return sd end |
#trustee ⇒ Object
11 12 13 14 15 16 |
# File 'lib/puppet/provider/fileshare/wmi/securitydescriptor.rb', line 11 def trustee trust = @wmi_session.get("Win32_Trustee").spawninstance_ trust.name = @username trust.sid = @sid return trust end |