Class: Sys::Admin::Group
- Inherits:
-
Object
- Object
- Sys::Admin::Group
- Defined in:
- lib/sys/admin/common.rb,
lib/windows/sys/admin.rb
Overview
The Group class encapsulates information found in /etc/group.
Instance Attribute Summary collapse
-
#caption ⇒ Object
Short description of the object.
-
#description ⇒ Object
Description of the group.
-
#domain ⇒ Object
Name of the Windows domain to which the group account belongs.
-
#gid ⇒ Object
The group ID.
-
#install_date ⇒ Object
Date the group was added.
-
#local ⇒ Object
writeonly
Sets whether or not the group is local (as opposed to global).
-
#members ⇒ Object
An array of members for that group.
-
#name ⇒ Object
Name of the Windows group account on the Group#domain specified.
-
#passwd ⇒ Object
The group password, if any.
-
#sid ⇒ Object
Security identifier for this group.
-
#status ⇒ Object
Current status for the group, such as “ok”, “error”, etc.
Instance Method Summary collapse
-
#initialize {|_self| ... } ⇒ Group
constructor
Creates and returns a new Group object.
-
#local? ⇒ Boolean
Returns whether or not the group is a local group.
-
#sid_type ⇒ Object
Returns the type of SID (Security Identifier) as a stringified value.
-
#sid_type=(stype) ⇒ Object
Sets the SID (Security Identifier) type to
stype
, which can be one of the following constant values:.
Constructor Details
#initialize {|_self| ... } ⇒ Group
Creates and returns a new Group object. This class encapsulates the information for a group account, whether it be global or local.
Yields self
if a block is given.
129 130 131 |
# File 'lib/sys/admin/common.rb', line 129 def initialize yield self if block_given? end |
Instance Attribute Details
#caption ⇒ Object
Short description of the object.
923 924 925 |
# File 'lib/windows/sys/admin.rb', line 923 def caption @caption end |
#description ⇒ Object
Description of the group.
926 927 928 |
# File 'lib/windows/sys/admin.rb', line 926 def description @description end |
#domain ⇒ Object
Name of the Windows domain to which the group account belongs.
929 930 931 |
# File 'lib/windows/sys/admin.rb', line 929 def domain @domain end |
#gid ⇒ Object
The group ID.
116 117 118 |
# File 'lib/sys/admin/common.rb', line 116 def gid @gid end |
#install_date ⇒ Object
Date the group was added.
932 933 934 |
# File 'lib/windows/sys/admin.rb', line 932 def install_date @install_date end |
#local=(value) ⇒ Object (writeonly)
Sets whether or not the group is local (as opposed to global).
947 948 949 |
# File 'lib/windows/sys/admin.rb', line 947 def local=(value) @local = value end |
#members ⇒ Object
An array of members for that group. May contain SID’s.
119 120 121 |
# File 'lib/sys/admin/common.rb', line 119 def members @members end |
#name ⇒ Object
Name of the Windows group account on the Group#domain specified.
113 114 115 |
# File 'lib/sys/admin/common.rb', line 113 def name @name end |
#passwd ⇒ Object
The group password, if any.
122 123 124 |
# File 'lib/sys/admin/common.rb', line 122 def passwd @passwd end |
#sid ⇒ Object
Security identifier for this group.
938 939 940 |
# File 'lib/windows/sys/admin.rb', line 938 def sid @sid end |
#status ⇒ Object
Current status for the group, such as “ok”, “error”, etc.
941 942 943 |
# File 'lib/windows/sys/admin.rb', line 941 def status @status end |
Instance Method Details
#local? ⇒ Boolean
Returns whether or not the group is a local group.
963 964 965 |
# File 'lib/windows/sys/admin.rb', line 963 def local? @local end |
#sid_type ⇒ Object
Returns the type of SID (Security Identifier) as a stringified value.
969 970 971 |
# File 'lib/windows/sys/admin.rb', line 969 def sid_type @sid_type end |
#sid_type=(stype) ⇒ Object
Sets the SID (Security Identifier) type to stype
, which can be one of the following constant values:
-
Admin::SidTypeUser
-
Admin::SidTypeGroup
-
Admin::SidTypeDomain
-
Admin::SidTypeAlias
-
Admin::SidTypeWellKnownGroup
-
Admin::SidTypeDeletedAccount
-
Admin::SidTypeInvalid
-
Admin::SidTypeUnknown
-
Admin::SidTypeComputer
986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 |
# File 'lib/windows/sys/admin.rb', line 986 def sid_type=(stype) if stype.kind_of?(String) @sid_type = stype.downcase else case stype when Admin::SidTypeUser @sid_type = "user" when Admin::SidTypeGroup @sid_type = "group" when Admin::SidTypeDomain @sid_type = "domain" when Admin::SidTypeAlias @sid_type = "alias" when Admin::SidTypeWellKnownGroup @sid_type = "well_known_group" when Admin::SidTypeDeletedAccount @sid_type = "deleted_account" when Admin::SidTypeInvalid @sid_type = "invalid" when Admin::SidTypeUnknown @sid_type = "unknown" when Admin::SidTypeComputer @sid_type = "computer" else @sid_type = "unknown" end end @sid_type end |