ruby-jss 1.4.1 → 1.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGES.md +95 -0
- data/THANKS.md +3 -2
- data/lib/jamf.rb +18 -17
- data/lib/jamf/api/base_classes/collection_resource.rb +613 -0
- data/lib/jamf/api/{abstract_classes → base_classes}/json_object.rb +109 -101
- data/lib/jamf/api/{abstract_classes → base_classes}/prestage.rb +55 -30
- data/lib/jamf/api/{abstract_classes → base_classes}/resource.rb +10 -6
- data/lib/jamf/api/{abstract_classes → base_classes}/singleton_resource.rb +4 -3
- data/lib/jamf/api/connection.rb +13 -9
- data/lib/jamf/api/connection/api_error.rb +8 -8
- data/lib/jamf/api/connection/token.rb +16 -15
- data/lib/jamf/api/json_objects/device_enrollment_device.rb +14 -7
- data/lib/jamf/api/json_objects/{location.rb → device_enrollment_device_sync_state.rb} +27 -41
- data/lib/jamf/api/json_objects/device_enrollment_sync_status.rb +1 -1
- data/lib/jamf/api/json_objects/{attachment.rb → locale.rb} +14 -23
- data/lib/jamf/api/json_objects/md_prestage_name.rb +1 -1
- data/lib/jamf/api/json_objects/md_prestage_names.rb +2 -2
- data/lib/jamf/api/json_objects/md_prestage_skip_setup_items.rb +50 -1
- data/lib/jamf/api/json_objects/prestage_assignment.rb +2 -2
- data/lib/jamf/api/json_objects/prestage_location.rb +3 -3
- data/lib/jamf/api/json_objects/prestage_purchasing_data.rb +7 -7
- data/lib/jamf/api/json_objects/prestage_scope.rb +1 -1
- data/lib/jamf/api/{resources/collection_resources → json_objects}/time_zone.rb +9 -23
- data/lib/jamf/api/mixins/{abstract.rb → base_class.rb} +34 -16
- data/lib/jamf/api/mixins/bulk_deletable.rb +27 -6
- data/lib/jamf/api/mixins/change_log.rb +201 -51
- data/lib/jamf/api/{resources/collection_resources/computer.rb → mixins/filterable.rb} +19 -17
- data/lib/jamf/api/mixins/pageable.rb +208 -0
- data/lib/jamf/api/{json_objects/installed_application.rb → mixins/sortable.rb} +33 -33
- data/lib/jamf/api/resources/collection_resources/building.rb +16 -9
- data/lib/jamf/api/resources/collection_resources/category.rb +5 -4
- data/lib/jamf/api/resources/collection_resources/computer_prestage.rb +12 -5
- data/lib/jamf/api/resources/collection_resources/department.rb +0 -2
- data/lib/jamf/api/resources/collection_resources/device_enrollment.rb +10 -10
- data/lib/jamf/api/resources/collection_resources/inventory_preload_record.rb +11 -3
- data/lib/jamf/api/resources/collection_resources/mobile_device_prestage.rb +25 -23
- data/lib/jamf/api/resources/collection_resources/script.rb +61 -25
- data/lib/jamf/api/resources/singleton_resources/app_store_country_codes.rb +15 -5
- data/lib/jamf/api/resources/singleton_resources/locales.rb +155 -0
- data/lib/jamf/api/resources/singleton_resources/time_zones.rb +213 -0
- data/lib/jamf/client.rb +3 -3
- data/lib/jamf/client/management_action.rb +2 -3
- data/lib/jamf/composer.rb +2 -2
- data/lib/jamf/utility.rb +35 -7
- data/lib/jamf/validate.rb +63 -24
- data/lib/jamf/version.rb +1 -1
- data/lib/jss.rb +2 -2
- data/lib/jss/api_connection.rb +114 -406
- data/lib/jss/api_object.rb +3 -19
- data/lib/jss/api_object/categorizable.rb +1 -1
- data/lib/jss/api_object/computer.rb +13 -0
- data/lib/jss/api_object/configuration_profile.rb +61 -5
- data/lib/jss/api_object/directory_binding_type.rb +66 -60
- data/lib/jss/api_object/directory_binding_type/active_directory.rb +71 -34
- data/lib/jss/api_object/directory_binding_type/admitmac.rb +536 -467
- data/lib/jss/api_object/directory_binding_type/centrify.rb +21 -7
- data/lib/jss/api_object/directory_binding_type/open_directory.rb +4 -4
- data/lib/jss/api_object/distribution_point.rb +2 -2
- data/lib/jss/api_object/dock_item.rb +102 -96
- data/lib/jss/api_object/extendable.rb +1 -1
- data/lib/jss/api_object/group.rb +33 -2
- data/lib/jss/api_object/network_segment.rb +45 -13
- data/lib/jss/api_object/patch_source.rb +10 -9
- data/lib/jss/api_object/policy.rb +155 -25
- data/lib/jss/api_object/printer.rb +10 -4
- data/lib/jss/api_object/scopable.rb +10 -15
- data/lib/jss/api_object/scopable/scope.rb +31 -30
- data/lib/jss/api_object/script.rb +242 -352
- data/lib/jss/api_object/user.rb +1 -1
- data/lib/jss/client/management_action.rb +1 -2
- data/lib/jss/composer.rb +2 -2
- data/lib/jss/exceptions.rb +3 -0
- data/lib/jss/server.rb +15 -0
- data/lib/jss/utility.rb +213 -45
- data/lib/jss/version.rb +1 -1
- metadata +46 -64
- data/lib/jamf/api/abstract_classes/advanced_search.rb +0 -86
- data/lib/jamf/api/abstract_classes/collection_resource.rb +0 -433
- data/lib/jamf/api/abstract_classes/generic_reference.rb +0 -145
- data/lib/jamf/api/abstract_classes/prestage_skip_setup_items.rb +0 -126
- data/lib/jamf/api/json_objects/account_prefs.rb +0 -79
- data/lib/jamf/api/json_objects/android_details.rb +0 -139
- data/lib/jamf/api/json_objects/appletv_details.rb +0 -110
- data/lib/jamf/api/json_objects/cellular_network.rb +0 -151
- data/lib/jamf/api/json_objects/computer_prestage_skip_setup_items.rb +0 -67
- data/lib/jamf/api/json_objects/criterion.rb +0 -152
- data/lib/jamf/api/json_objects/extension_attribute_value.rb +0 -128
- data/lib/jamf/api/json_objects/installed_certificate.rb +0 -53
- data/lib/jamf/api/json_objects/installed_configuration_profile.rb +0 -67
- data/lib/jamf/api/json_objects/installed_ebook.rb +0 -58
- data/lib/jamf/api/json_objects/installed_provisioning_profile.rb +0 -59
- data/lib/jamf/api/json_objects/ios_details.rb +0 -244
- data/lib/jamf/api/json_objects/mobile_device_details.rb +0 -219
- data/lib/jamf/api/json_objects/mobile_device_security.rb +0 -101
- data/lib/jamf/api/json_objects/purchasing_data.rb +0 -125
- data/lib/jamf/api/mixins/locatable.rb +0 -124
- data/lib/jamf/api/mixins/referable.rb +0 -92
- data/lib/jamf/api/resources/collection_resources/account.rb +0 -163
- data/lib/jamf/api/resources/collection_resources/advanced_mobile_device_search.rb +0 -52
- data/lib/jamf/api/resources/collection_resources/advanced_user_search.rb +0 -52
- data/lib/jamf/api/resources/collection_resources/extension_attribute.rb +0 -45
- data/lib/jamf/api/resources/collection_resources/mobile_device.rb +0 -315
- data/lib/jamf/api/resources/collection_resources/site.rb +0 -77
- data/lib/jamf/api/resources/singleton_resources/authorization.rb +0 -88
- data/lib/jamf/api/resources/singleton_resources/client_checkin_settings.rb +0 -139
- data/lib/jamf/api/resources/singleton_resources/reenrollment_settings.rb +0 -95
|
@@ -24,502 +24,571 @@
|
|
|
24
24
|
###
|
|
25
25
|
|
|
26
26
|
module JSS
|
|
27
|
-
|
|
28
|
-
# Module for containing the different types of DirectoryBindings stored within the JSS
|
|
29
|
-
|
|
30
|
-
module DirectoryBindingType
|
|
31
|
-
|
|
32
|
-
# Module Variables
|
|
33
|
-
#####################################
|
|
34
|
-
|
|
35
|
-
# Module Methods
|
|
36
|
-
#####################################
|
|
37
|
-
|
|
38
|
-
# Classes
|
|
39
|
-
#####################################
|
|
40
|
-
|
|
41
|
-
# Class for the specific ADmitMac DirectoryBinding type stored within the JSS
|
|
42
|
-
#
|
|
43
|
-
# @author Tyler Morgan
|
|
44
|
-
#
|
|
45
|
-
# @note "Map Home Directory To Attribute" is currently only available in the Jamf Pro UI not through the API.
|
|
46
|
-
#
|
|
47
|
-
# Attributes
|
|
48
|
-
# @!attribute [rw] require_confirmation
|
|
49
|
-
# @!attribute [rw] local_home
|
|
50
|
-
# @!attribute [rw] mount_style
|
|
51
|
-
# @!attribute [rw] default_shell
|
|
52
|
-
# @!attribute [rw] mount_network_home
|
|
53
|
-
# @!attribute [rw] place_home_folders
|
|
54
|
-
# @!attribute [rw] uid
|
|
55
|
-
# @!attribute [rw] user_gid
|
|
56
|
-
# @!attribute [rw] gid
|
|
57
|
-
# @!attribute [rw] admin_group
|
|
58
|
-
# @!attribute [rw] cached_credentials
|
|
59
|
-
# @!attribute [rw] add_user_to_local
|
|
60
|
-
# @!attribute [rw] users_ou
|
|
61
|
-
# @!attribute [rw] groups_ou
|
|
62
|
-
# @!attribute [rw] printers_ou
|
|
63
|
-
# @!attribute [rw] shared_folders_ou
|
|
64
|
-
# TODO: Include default values upon creation
|
|
65
|
-
|
|
66
|
-
class ADmitMac < DirectoryBindingType
|
|
67
|
-
# Mix-Ins
|
|
68
|
-
#####################################
|
|
69
|
-
|
|
70
|
-
# Class Methods
|
|
71
|
-
#####################################
|
|
72
|
-
|
|
73
|
-
# Class Constants
|
|
74
|
-
#####################################
|
|
75
|
-
|
|
76
|
-
# Attributes
|
|
77
|
-
#####################################
|
|
78
|
-
|
|
79
|
-
attr_reader :require_confirmation
|
|
80
|
-
attr_reader :local_home
|
|
81
|
-
attr_reader :mount_style
|
|
82
|
-
attr_reader :default_shell
|
|
83
|
-
attr_reader :mount_network_home
|
|
84
|
-
attr_reader :place_home_folders
|
|
85
|
-
attr_reader :uid
|
|
86
|
-
attr_reader :user_gid
|
|
87
|
-
attr_reader :gid
|
|
88
|
-
attr_reader :admin_group
|
|
89
|
-
attr_reader :cached_credentials
|
|
90
|
-
attr_reader :add_user_to_local
|
|
91
|
-
attr_reader :users_ou
|
|
92
|
-
attr_reader :groups_ou
|
|
93
|
-
attr_reader :printers_ou
|
|
94
|
-
attr_reader :shared_folders_ou
|
|
95
|
-
|
|
96
|
-
# Constructor
|
|
97
|
-
#####################################
|
|
98
|
-
|
|
99
|
-
# An initializer for the ADmitMac object.
|
|
100
|
-
#
|
|
101
|
-
# @author Tyler Morgan
|
|
102
|
-
# @see JSS::DirectoryBinding
|
|
103
|
-
# @see JSS::DirectoryBindingType
|
|
104
|
-
#
|
|
105
|
-
# @note Due to a JSS API funk, mount_style is not able to be configured through the API. It is linked to place_home_folders
|
|
106
|
-
#
|
|
107
|
-
# @param [Hash] initialize data
|
|
108
|
-
def initialize(init_data)
|
|
109
|
-
|
|
110
|
-
# Return without processing anything since there is
|
|
111
|
-
# nothing to process.
|
|
112
|
-
return if init_data.nil?
|
|
113
|
-
|
|
114
|
-
# Process the provided information
|
|
115
|
-
@require_confirmation = init_data[:require_confirmation]
|
|
116
|
-
@default_shell = init_data[:default_shell]
|
|
117
|
-
@mount_network_home = init_data[:mount_network_home]
|
|
118
|
-
@place_home_folders = init_data[:place_home_folders]
|
|
119
|
-
@uid = init_data[:uid]
|
|
120
|
-
@user_gid = init_data[:user_gid]
|
|
121
|
-
@gid = init_data[:gid]
|
|
122
|
-
@cached_credentials = init_data[:cached_credentials]
|
|
123
|
-
@add_user_to_local = init_data[:add_user_to_local]
|
|
124
|
-
@users_ou = init_data[:users_ou]
|
|
125
|
-
@groups_ou = init_data[:groups_ou]
|
|
126
|
-
@printers_ou = init_data[:printers_ou]
|
|
127
|
-
@shared_folders_ou = init_data[:shared_folders_ou]
|
|
128
|
-
@mount_style = init_data[:mount_style]
|
|
129
|
-
|
|
130
|
-
if init_data[:local_home].nil? || init_data[:local_home].is_a?(String)
|
|
131
|
-
raise JSS::InvalidDataError, "Local Home must be one of #{HOME_FOLDER_TYPE.values.join(', ')}." unless HOME_FOLDER_TYPE.values.include? init_data[:local_home] || init_data[:local_home].nil?
|
|
132
|
-
|
|
133
|
-
@local_home = init_data[:local_home]
|
|
134
|
-
else
|
|
135
|
-
raise JSS::InvalidDataError, "Local Home must be one of :#{HOME_FOLDER_TYPE.keys.join(',:')}." unless HOME_FOLDER_TYPE.keys.include? init_data[:local_home]
|
|
136
|
-
end
|
|
137
|
-
|
|
138
|
-
if init_data[:admin_group].nil?
|
|
139
|
-
# This is needed since we have the ability to add and
|
|
140
|
-
# remove admin groups from this array.
|
|
141
|
-
@admin_group = []
|
|
142
|
-
elsif init_data[:admin_group].is_a? String
|
|
143
|
-
@admin_group = init_data[:admin_group].split(',')
|
|
144
|
-
else
|
|
145
|
-
@admin_group = init_data[:admin_group]
|
|
146
|
-
end
|
|
147
|
-
end
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
# Public Instance Methods
|
|
152
|
-
#####################################
|
|
153
|
-
|
|
154
|
-
# Require confirmation before creating a mobile account on the system.
|
|
155
|
-
#
|
|
156
|
-
# @author Tyler Morgan
|
|
157
|
-
#
|
|
158
|
-
# @param newvalue [Bool]
|
|
159
|
-
#
|
|
160
|
-
# @raise [JSS::InvalidDataError] If the new value doesn't match a Bool value
|
|
161
|
-
#
|
|
162
|
-
# @return [void]
|
|
163
|
-
def require_confirmation=(newvalue)
|
|
164
|
-
|
|
165
|
-
raise JSS::InvalidDataError, "require_confirmation must be true or false." unless newvalue.is_a? Bool
|
|
166
|
-
|
|
167
|
-
@require_confirmation = newvalue
|
|
168
|
-
|
|
169
|
-
self.container&.should_update
|
|
170
|
-
end
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
# The type of home directory type created upon logging into a system
|
|
174
|
-
#
|
|
175
|
-
# @author Tyler Morgan
|
|
176
|
-
#
|
|
177
|
-
# @param newvalue [Symbol] The key specific to the folder type you want in HOME_FOLDER_TYPE
|
|
178
|
-
# @see JSS::DirectoryBindingType::HOME_FOLDER_TYPE
|
|
179
|
-
#
|
|
180
|
-
# @raise [JSS::InvalidDataError] If the new value is not one of the possible keys in HOME_FOLDER_TYPE
|
|
181
|
-
#
|
|
182
|
-
# @return [void]
|
|
183
|
-
def local_home=(newvalue)
|
|
184
|
-
|
|
185
|
-
raise JSS::InvalidDataError, "local_home must be one of :#{HOME_FOLDER_TYPE.keys.join(',:')}." unless HOME_FOLDER_TYPE.keys.include? newvalue
|
|
186
|
-
|
|
187
|
-
@local_home = HOME_FOLDER_TYPE[newvalue]
|
|
188
|
-
|
|
189
|
-
self.container&.should_update
|
|
190
|
-
end
|
|
191
|
-
|
|
192
|
-
# The default shell assigned first upon logging into a system
|
|
193
|
-
#
|
|
194
|
-
# @author Tyler Morgan
|
|
195
|
-
#
|
|
196
|
-
# @param newvalue [String] The string path of the shell file being set as the default
|
|
197
|
-
#
|
|
198
|
-
# @raise [JSS::InvalidDataError] If the new value is not a String
|
|
199
|
-
#
|
|
200
|
-
# @return [void]
|
|
201
|
-
def default_shell=(newvalue)
|
|
202
|
-
|
|
203
|
-
raise JSS::InvalidDataError, "default_shell must be empty or a string." unless newvalue.is_a?(String)
|
|
204
|
-
|
|
205
|
-
@default_shell = newvalue
|
|
206
|
-
|
|
207
|
-
self.container&.should_update
|
|
208
|
-
end
|
|
209
27
|
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
28
|
+
# Module for containing the different types of DirectoryBindings stored within the JSS
|
|
29
|
+
|
|
30
|
+
module DirectoryBindingType
|
|
31
|
+
|
|
32
|
+
# Module Variables
|
|
33
|
+
#####################################
|
|
34
|
+
|
|
35
|
+
# Module Methods
|
|
36
|
+
#####################################
|
|
37
|
+
|
|
38
|
+
# Classes
|
|
39
|
+
#####################################
|
|
40
|
+
|
|
41
|
+
# Class for the specific ADmitMac DirectoryBinding type stored within the JSS
|
|
42
|
+
#
|
|
43
|
+
# @author Tyler Morgan
|
|
44
|
+
#
|
|
45
|
+
# @note "Map Home Directory To Attribute" is currently only available in the Jamf Pro UI not through the API.
|
|
46
|
+
#
|
|
47
|
+
# Attributes
|
|
48
|
+
# @!attribute [rw] require_confirmation
|
|
49
|
+
# @!attribute [rw] local_home
|
|
50
|
+
# @!attribute [rw] mount_style
|
|
51
|
+
# @!attribute [rw] default_shell
|
|
52
|
+
# @!attribute [rw] mount_network_home
|
|
53
|
+
# @!attribute [rw] place_home_folders
|
|
54
|
+
# @!attribute [rw] uid
|
|
55
|
+
# @!attribute [rw] user_gid
|
|
56
|
+
# @!attribute [rw] gid
|
|
57
|
+
# @!attribute [rw] admin_group
|
|
58
|
+
# @!attribute [rw] cached_credentials
|
|
59
|
+
# @!attribute [rw] add_user_to_local
|
|
60
|
+
# @!attribute [rw] users_ou
|
|
61
|
+
# @!attribute [rw] groups_ou
|
|
62
|
+
# @!attribute [rw] printers_ou
|
|
63
|
+
# @!attribute [rw] shared_folders_ou
|
|
64
|
+
# TODO: Include default values upon creation
|
|
65
|
+
class ADmitMac < DirectoryBindingType
|
|
66
|
+
|
|
67
|
+
# Mix-Ins
|
|
68
|
+
#####################################
|
|
69
|
+
|
|
70
|
+
# Class Methods
|
|
71
|
+
#####################################
|
|
72
|
+
|
|
73
|
+
# Class Constants
|
|
74
|
+
#####################################
|
|
75
|
+
|
|
76
|
+
# Attributes
|
|
77
|
+
#####################################
|
|
78
|
+
|
|
79
|
+
attr_reader :require_confirmation
|
|
80
|
+
attr_reader :local_home
|
|
81
|
+
attr_reader :mount_style
|
|
82
|
+
attr_reader :default_shell
|
|
83
|
+
attr_reader :mount_network_home
|
|
84
|
+
attr_reader :place_home_folders
|
|
85
|
+
attr_reader :uid
|
|
86
|
+
attr_reader :user_gid
|
|
87
|
+
attr_reader :gid
|
|
88
|
+
attr_reader :admin_group
|
|
89
|
+
attr_reader :cached_credentials
|
|
90
|
+
attr_reader :add_user_to_local
|
|
91
|
+
attr_reader :users_ou
|
|
92
|
+
attr_reader :groups_ou
|
|
93
|
+
attr_reader :printers_ou
|
|
94
|
+
attr_reader :shared_folders_ou
|
|
95
|
+
|
|
96
|
+
# Constructor
|
|
97
|
+
#####################################
|
|
98
|
+
|
|
99
|
+
# An initializer for the ADmitMac object.
|
|
100
|
+
#
|
|
101
|
+
# @author Tyler Morgan
|
|
102
|
+
# @see JSS::DirectoryBinding
|
|
103
|
+
# @see JSS::DirectoryBindingType
|
|
104
|
+
#
|
|
105
|
+
# @note Due to a JSS API funk, mount_style is not able to be configured through the API. It is linked to place_home_folders
|
|
106
|
+
#
|
|
107
|
+
# @param [Hash] initialize data
|
|
108
|
+
def initialize(init_data)
|
|
109
|
+
# Return without processing anything since there is
|
|
110
|
+
# nothing to process.
|
|
111
|
+
return if init_data.nil?
|
|
112
|
+
|
|
113
|
+
# Process the provided information
|
|
114
|
+
@require_confirmation = init_data[:require_confirmation]
|
|
115
|
+
@default_shell = init_data[:default_shell]
|
|
116
|
+
@mount_network_home = init_data[:mount_network_home]
|
|
117
|
+
@place_home_folders = init_data[:place_home_folders]
|
|
118
|
+
@uid = init_data[:uid]
|
|
119
|
+
@user_gid = init_data[:user_gid]
|
|
120
|
+
@gid = init_data[:gid]
|
|
121
|
+
@cached_credentials = init_data[:cached_credentials]
|
|
122
|
+
@add_user_to_local = init_data[:add_user_to_local]
|
|
123
|
+
@users_ou = init_data[:users_ou]
|
|
124
|
+
@groups_ou = init_data[:groups_ou]
|
|
125
|
+
@printers_ou = init_data[:printers_ou]
|
|
126
|
+
@shared_folders_ou = init_data[:shared_folders_ou]
|
|
127
|
+
@mount_style = init_data[:mount_style]
|
|
128
|
+
|
|
129
|
+
if init_data[:local_home].nil? || init_data[:local_home].is_a?(String)
|
|
130
|
+
unless HOME_FOLDER_TYPE.values.include? init_data[:local_home] || init_data[:local_home].nil?
|
|
131
|
+
raise JSS::InvalidDataError, "Local Home must be one of #{HOME_FOLDER_TYPE.values.join(', ')}."
|
|
227
132
|
end
|
|
228
133
|
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
# @param newvalue [String] The string path of the folder which user's directory files and folders will be created
|
|
234
|
-
#
|
|
235
|
-
# @raise [JSS::InvalidDataError] If the new value is not a String
|
|
236
|
-
#
|
|
237
|
-
# @return [void]
|
|
238
|
-
def place_home_folders=(newvalue)
|
|
239
|
-
|
|
240
|
-
raise JSS::InvalidDataError, "place_home_folders must be a string." unless newvalue.is_a? String
|
|
241
|
-
|
|
242
|
-
@place_home_folders = newvalue
|
|
243
|
-
|
|
244
|
-
self.container&.should_update
|
|
134
|
+
@local_home = init_data[:local_home]
|
|
135
|
+
else
|
|
136
|
+
unless HOME_FOLDER_TYPE.keys.include? init_data[:local_home]
|
|
137
|
+
raise JSS::InvalidDataError, "Local Home must be one of :#{HOME_FOLDER_TYPE.keys.join(',:')}."
|
|
245
138
|
end
|
|
139
|
+
end
|
|
246
140
|
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
141
|
+
@admin_group = if init_data[:admin_group].nil?
|
|
142
|
+
# This is needed since we have the ability to add and
|
|
143
|
+
# remove admin groups from this array.
|
|
144
|
+
[]
|
|
145
|
+
elsif init_data[:admin_group].is_a? String
|
|
146
|
+
init_data[:admin_group].split(',')
|
|
147
|
+
else
|
|
148
|
+
init_data[:admin_group]
|
|
149
|
+
end
|
|
150
|
+
end
|
|
151
|
+
|
|
152
|
+
# Public Instance Methods
|
|
153
|
+
#####################################
|
|
154
|
+
|
|
155
|
+
# Require confirmation before creating a mobile account on the system.
|
|
156
|
+
#
|
|
157
|
+
# @author Tyler Morgan
|
|
158
|
+
#
|
|
159
|
+
# @param newvalue [Bool]
|
|
160
|
+
#
|
|
161
|
+
# @raise [JSS::InvalidDataError] If the new value doesn't match a Bool value
|
|
162
|
+
#
|
|
163
|
+
# @return [void]
|
|
164
|
+
def require_confirmation=(newvalue)
|
|
165
|
+
raise JSS::InvalidDataError, 'require_confirmation must be true or false.' unless newvalue.is_a?(TrueClass) || newvalue.is_a(FalseClass)
|
|
166
|
+
|
|
167
|
+
@require_confirmation = newvalue
|
|
168
|
+
|
|
169
|
+
container&.should_update
|
|
170
|
+
end
|
|
171
|
+
|
|
172
|
+
# The type of home directory type created upon logging into a system
|
|
173
|
+
#
|
|
174
|
+
# @author Tyler Morgan
|
|
175
|
+
#
|
|
176
|
+
# @param newvalue [Symbol] The key specific to the folder type you want in HOME_FOLDER_TYPE
|
|
177
|
+
# @see JSS::DirectoryBindingType::HOME_FOLDER_TYPE
|
|
178
|
+
#
|
|
179
|
+
# @raise [JSS::InvalidDataError] If the new value is not one of the possible keys in HOME_FOLDER_TYPE
|
|
180
|
+
#
|
|
181
|
+
# @return [void]
|
|
182
|
+
def local_home=(newvalue)
|
|
183
|
+
new =
|
|
184
|
+
if newvalue.to_s.empty?
|
|
185
|
+
JSS::BLANK
|
|
186
|
+
else
|
|
187
|
+
# Data Check
|
|
188
|
+
raise JSS::InvalidDataError, "local_home must be one of :#{HOME_FOLDER_TYPE.keys.join(',:')}." unless HOME_FOLDER_TYPE.keys.include? newvalue
|
|
189
|
+
|
|
190
|
+
HOME_FOLDER_TYPE[newvalue]
|
|
267
191
|
end
|
|
268
192
|
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
193
|
+
@local_home = new
|
|
194
|
+
|
|
195
|
+
container&.should_update
|
|
196
|
+
end
|
|
197
|
+
|
|
198
|
+
# The default shell assigned first upon logging into a system
|
|
199
|
+
#
|
|
200
|
+
# @author Tyler Morgan
|
|
201
|
+
#
|
|
202
|
+
# @param newvalue [String] The string path of the shell file being set as the default
|
|
203
|
+
#
|
|
204
|
+
# @raise [JSS::InvalidDataError] If the new value is not a String
|
|
205
|
+
#
|
|
206
|
+
# @return [void]
|
|
207
|
+
def default_shell=(newvalue)
|
|
208
|
+
new =
|
|
209
|
+
if newvalue.to_s.empty?
|
|
210
|
+
JSS::BLANK
|
|
211
|
+
else
|
|
212
|
+
# Data Check
|
|
213
|
+
raise JSS::InvalidDataError, 'default_shell must be empty or a string.' unless newvalue.is_a?(String)
|
|
214
|
+
|
|
215
|
+
newvalue
|
|
286
216
|
end
|
|
287
217
|
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
218
|
+
@default_shell = new
|
|
219
|
+
|
|
220
|
+
container&.should_update
|
|
221
|
+
end
|
|
222
|
+
|
|
223
|
+
# Mount network home folder on desktop
|
|
224
|
+
#
|
|
225
|
+
# @author Tyler Morgan
|
|
226
|
+
#
|
|
227
|
+
# @param newvalue [Bool]
|
|
228
|
+
#
|
|
229
|
+
# @raise [JSS::InvalidDataError] If the new value is not a Bool
|
|
230
|
+
#
|
|
231
|
+
# @return [void]
|
|
232
|
+
def mount_network_home=(newvalue)
|
|
233
|
+
raise JSS::InvalidDataError, 'mount_network_home must be true or false.' unless newvalue.is_a?(TrueClass) || newvalue.is_a(FalseClass)
|
|
234
|
+
|
|
235
|
+
@mount_network_home = newvalue
|
|
236
|
+
|
|
237
|
+
container&.should_update
|
|
238
|
+
end
|
|
239
|
+
|
|
240
|
+
# Path at which home folders are placed
|
|
241
|
+
#
|
|
242
|
+
# @author Tyler Morgan
|
|
243
|
+
#
|
|
244
|
+
# @param newvalue [String] The string path of the folder which user's directory files and folders will be created
|
|
245
|
+
#
|
|
246
|
+
# @raise [JSS::InvalidDataError] If the new value is not a String
|
|
247
|
+
#
|
|
248
|
+
# @return [void]
|
|
249
|
+
def place_home_folders=(newvalue)
|
|
250
|
+
new =
|
|
251
|
+
if newvalue.to_s.empty?
|
|
252
|
+
JSS::BLANK
|
|
253
|
+
else
|
|
254
|
+
# Data Check
|
|
255
|
+
raise JSS::InvalidDataError, 'place_home_folders must be a string.' unless newvalue.is_a? String
|
|
256
|
+
|
|
257
|
+
newvalue
|
|
305
258
|
end
|
|
306
259
|
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
260
|
+
@place_home_folders = new
|
|
261
|
+
|
|
262
|
+
container&.should_update
|
|
263
|
+
end
|
|
264
|
+
|
|
265
|
+
# Jamf has these linked for some reason...
|
|
266
|
+
alias mount_style place_home_folders
|
|
267
|
+
|
|
268
|
+
# Map specific UID to Attribute
|
|
269
|
+
#
|
|
270
|
+
# @author Tyler Morgan
|
|
271
|
+
#
|
|
272
|
+
# @param newvalue [String] The UID you want to be mapped
|
|
273
|
+
#
|
|
274
|
+
# @raise [JSS::InvalidDataError] If the new value is not a String
|
|
275
|
+
#
|
|
276
|
+
# @return [void]
|
|
277
|
+
def uid=(newvalue)
|
|
278
|
+
new =
|
|
279
|
+
if newvalue.to_s.empty?
|
|
280
|
+
JSS::BLANK
|
|
281
|
+
else
|
|
282
|
+
# Data Check
|
|
283
|
+
raise JSS::InvalidDataError, 'uid must be a string, integer, or nil.' unless newvalue.is_a?(String) || newvalue.is_a?(Integer) || newvalue.nil?
|
|
284
|
+
|
|
285
|
+
newvalue
|
|
325
286
|
end
|
|
326
287
|
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
288
|
+
@uid = new
|
|
289
|
+
|
|
290
|
+
container&.should_update
|
|
291
|
+
end
|
|
292
|
+
|
|
293
|
+
# Map specific a User's GID to Attribute
|
|
294
|
+
#
|
|
295
|
+
# @author Tyler Morgan
|
|
296
|
+
#
|
|
297
|
+
# @param newvalue [String] The User's GID you want to be mapped
|
|
298
|
+
#
|
|
299
|
+
# @raise [JSS::InvalidDataError] If the new value is not a String
|
|
300
|
+
#
|
|
301
|
+
# @return [void]
|
|
302
|
+
def user_gid=(newvalue)
|
|
303
|
+
new =
|
|
304
|
+
if newvalue.to_s.empty?
|
|
305
|
+
JSS::BLANK
|
|
306
|
+
else
|
|
307
|
+
# Data Check
|
|
308
|
+
raise JSS::InvalidDataError, 'user_gid must be a string, integer, or nil.' unless newvalue.is_a?(String) || newvalue.is_a?(Integer) || newvalue.nil?
|
|
309
|
+
|
|
310
|
+
newvalue
|
|
344
311
|
end
|
|
345
312
|
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
313
|
+
@user_gid = new
|
|
314
|
+
|
|
315
|
+
container&.should_update
|
|
316
|
+
end
|
|
317
|
+
|
|
318
|
+
# Map specific GID to Attribute
|
|
319
|
+
#
|
|
320
|
+
# @author Tyler Morgan
|
|
321
|
+
#
|
|
322
|
+
# @param newvalue [String] The GID you want to be mapped
|
|
323
|
+
#
|
|
324
|
+
# @raise [JSS::InvalidDataError] If the new value is not a String
|
|
325
|
+
#
|
|
326
|
+
# @return [void]
|
|
327
|
+
def gid=(newvalue)
|
|
328
|
+
new =
|
|
329
|
+
if newvalue.to_s.empty?
|
|
330
|
+
JSS::BLANK
|
|
331
|
+
else
|
|
332
|
+
# Data Check
|
|
333
|
+
raise JSS::InvalidDataError, 'gid must be a string, integer, or nil.' unless newvalue.is_a?(String) || newvalue.is_a?(Integer) || newvalue.nil?
|
|
334
|
+
|
|
335
|
+
newvalue
|
|
365
336
|
end
|
|
366
337
|
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
338
|
+
@gid = new
|
|
339
|
+
|
|
340
|
+
container&.should_update
|
|
341
|
+
end
|
|
342
|
+
|
|
343
|
+
# Set specific groups to become administrators to a system.
|
|
344
|
+
#
|
|
345
|
+
# @author Tyler Morgan
|
|
346
|
+
#
|
|
347
|
+
# @param newvalue [Array<String>] An array of all the admin group names you want to set.
|
|
348
|
+
# @see add_admin_group
|
|
349
|
+
# @see remove_admin_group
|
|
350
|
+
#
|
|
351
|
+
# @raise [JSS::InvalidDataError] If the new value is not an Array
|
|
352
|
+
#
|
|
353
|
+
# @return [void]
|
|
354
|
+
def admin_group=(newvalue)
|
|
355
|
+
new =
|
|
356
|
+
if newvalue.to_s.empty?
|
|
357
|
+
JSS::BLANK
|
|
358
|
+
else
|
|
359
|
+
# Data Check
|
|
360
|
+
unless newvalue.is_a? Array
|
|
361
|
+
raise JSS::InvalidDataError, 'An Array must be provided, please use add_admin_group and remove_admin_group for individual group additions and removals.'
|
|
362
|
+
end
|
|
363
|
+
|
|
364
|
+
newvalue
|
|
385
365
|
end
|
|
386
366
|
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
367
|
+
@admin_group = new
|
|
368
|
+
|
|
369
|
+
container&.should_update
|
|
370
|
+
end
|
|
371
|
+
|
|
372
|
+
# The number of times a user can log into the device while not connected to a network
|
|
373
|
+
#
|
|
374
|
+
# @author Tyler Morgan
|
|
375
|
+
#
|
|
376
|
+
# @param newvalue [Integer] The number of times you want a user to login while not connected to a network
|
|
377
|
+
#
|
|
378
|
+
# @raise [JSS::InvalidDataError] If the new value is not an Integer
|
|
379
|
+
#
|
|
380
|
+
# @return [void]
|
|
381
|
+
def cached_credentials=(newvalue)
|
|
382
|
+
new =
|
|
383
|
+
if newvalue.to_s.empty?
|
|
384
|
+
JSS::BLANK
|
|
385
|
+
else
|
|
386
|
+
# Data Check
|
|
387
|
+
raise JSS::InvalidDataError, 'cached_credentials must be an integer.' unless newvalue.is_a? Integer
|
|
388
|
+
|
|
389
|
+
newvalue
|
|
405
390
|
end
|
|
406
391
|
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
392
|
+
@cached_credentials = new
|
|
393
|
+
|
|
394
|
+
container&.should_update
|
|
395
|
+
end
|
|
396
|
+
|
|
397
|
+
# If the user is a member of one of the groups in admin_group, add them
|
|
398
|
+
# to the local administrator group.
|
|
399
|
+
#
|
|
400
|
+
# @author Tyler Morgan
|
|
401
|
+
# @see admin_group
|
|
402
|
+
#
|
|
403
|
+
# @param newvalue [Bool]
|
|
404
|
+
#
|
|
405
|
+
# @raise [JSS::InvalidDataError] If the new value is not a Bool
|
|
406
|
+
#
|
|
407
|
+
# @return [void]
|
|
408
|
+
def add_user_to_local=(newvalue)
|
|
409
|
+
raise JSS::InvalidDataError, 'add_user_to_local must be true or false.' unless newvalue.is_a?(TrueClass) || newvalue.is_a(FalseClass)
|
|
410
|
+
|
|
411
|
+
@add_user_to_local = newvalue
|
|
412
|
+
|
|
413
|
+
container&.should_update
|
|
414
|
+
end
|
|
415
|
+
|
|
416
|
+
# An OU path for specific Users
|
|
417
|
+
#
|
|
418
|
+
# @author Tyler Morgan
|
|
419
|
+
#
|
|
420
|
+
# @param newvalue [String] The OU path for the specific user
|
|
421
|
+
# @note Not sure what this is used for
|
|
422
|
+
#
|
|
423
|
+
# @raise [JSS::InvalidDataError] If the new value is not a String
|
|
424
|
+
#
|
|
425
|
+
# @return [void]
|
|
426
|
+
def users_ou=(newvalue)
|
|
427
|
+
new =
|
|
428
|
+
if newvalue.to_s.empty?
|
|
429
|
+
JSS::BLANK
|
|
430
|
+
else
|
|
431
|
+
# Data Check
|
|
432
|
+
raise JSS::InvalidDataError, 'users_ou must be either a string or nil.' unless newvalue.is_a? String || newvalue.nil?
|
|
433
|
+
|
|
434
|
+
newvalue
|
|
425
435
|
end
|
|
426
436
|
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
437
|
+
@users_ou = new
|
|
438
|
+
|
|
439
|
+
container&.should_update
|
|
440
|
+
end
|
|
441
|
+
|
|
442
|
+
# An OU path for specific User Groups
|
|
443
|
+
#
|
|
444
|
+
# @author Tyler Morgan
|
|
445
|
+
#
|
|
446
|
+
# @param newvalue [String] The OU path for the specific user group
|
|
447
|
+
# @note Not sure what this is used for
|
|
448
|
+
#
|
|
449
|
+
# @raise [JSS::InvalidDataError] If the new value is not a String
|
|
450
|
+
#
|
|
451
|
+
# @return [void]
|
|
452
|
+
def groups_ou=(newvalue)
|
|
453
|
+
new =
|
|
454
|
+
if newvalue.to_s.empty?
|
|
455
|
+
JSS::BLANK
|
|
456
|
+
else
|
|
457
|
+
# Data Check
|
|
458
|
+
raise JSS::InvalidDataError, 'groups_ou must be either a string or nil.' unless newvalue.is_a? String || newvalue.nil?
|
|
459
|
+
|
|
460
|
+
newvalue
|
|
445
461
|
end
|
|
446
462
|
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
463
|
+
@groups_ou = new
|
|
464
|
+
|
|
465
|
+
container&.should_update
|
|
466
|
+
end
|
|
467
|
+
|
|
468
|
+
# An OU path for specific Printers
|
|
469
|
+
#
|
|
470
|
+
# @author Tyler Morgan
|
|
471
|
+
#
|
|
472
|
+
# @param newvalue [String] The OU path for the specific printer
|
|
473
|
+
# @note Not sure what this is used for
|
|
474
|
+
#
|
|
475
|
+
# @raise [JSS::InvalidDataError] If the new value is not a String
|
|
476
|
+
#
|
|
477
|
+
# @return [void]
|
|
478
|
+
def printers_ou=(newvalue)
|
|
479
|
+
new =
|
|
480
|
+
if newvalue.to_s.empty?
|
|
481
|
+
JSS::BLANK
|
|
482
|
+
else
|
|
483
|
+
# Data Check
|
|
484
|
+
raise JSS::InvalidDataError, 'printers_ou must be either a string or nil.' unless newvalue.is_a? String || newvalue.nil?
|
|
485
|
+
|
|
486
|
+
newvalue
|
|
468
487
|
end
|
|
469
488
|
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
489
|
+
@printers_ou = new
|
|
490
|
+
|
|
491
|
+
container&.should_update
|
|
492
|
+
end
|
|
493
|
+
|
|
494
|
+
# An OU path for specific shared folders
|
|
495
|
+
#
|
|
496
|
+
# @author Tyler Morgan
|
|
497
|
+
#
|
|
498
|
+
# @param newvalue [String] The OU path for the specific shared folders
|
|
499
|
+
# @note Not sure what this is used for
|
|
500
|
+
#
|
|
501
|
+
# @raise [JSS::InvalidDataError] If the new value is not a String
|
|
502
|
+
#
|
|
503
|
+
# @return [void]
|
|
504
|
+
def shared_folders_ou=(newvalue)
|
|
505
|
+
new =
|
|
506
|
+
if newvalue.to_s.empty?
|
|
507
|
+
JSS::BLANK
|
|
508
|
+
else
|
|
509
|
+
# Data Check
|
|
510
|
+
raise JSS::InvalidDataError, 'shared_folders_ou must be either a string or nil.' unless newvalue.is_a? String || newvalue.nil?
|
|
511
|
+
|
|
512
|
+
newvalue
|
|
491
513
|
end
|
|
492
514
|
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
515
|
+
@shared_folders_ou = new
|
|
516
|
+
|
|
517
|
+
container&.should_update
|
|
518
|
+
end
|
|
519
|
+
|
|
520
|
+
# An a specific admin group to admin_group
|
|
521
|
+
#
|
|
522
|
+
# @author Tyler Morgan
|
|
523
|
+
#
|
|
524
|
+
# @param value [String] The admin group name you wish to add to the admin group list
|
|
525
|
+
#
|
|
526
|
+
# @raise [JSS::InvalidDataError] If the value provided is not a String
|
|
527
|
+
# @raise [JSS::InvalidDataError] If the group provided is already a member of the admin_group array
|
|
528
|
+
#
|
|
529
|
+
# @return [Array <String>] An array of all the admin groups currently set.
|
|
530
|
+
def add_admin_group(value)
|
|
531
|
+
raise JSS::InvalidDataError, 'Admin group must be a string.' unless value.is_a? String
|
|
532
|
+
raise JSS::InvalidDataError, "Admin group \"#{value}\" already is in the list of admin groups." if @admin_group.include? value
|
|
533
|
+
|
|
534
|
+
@admin_group << value
|
|
535
|
+
|
|
536
|
+
container&.should_update
|
|
537
|
+
|
|
538
|
+
@admin_group
|
|
539
|
+
end
|
|
540
|
+
|
|
541
|
+
# Remove a specific admin group to admin_group
|
|
542
|
+
#
|
|
543
|
+
# @author Tyler Morgan
|
|
544
|
+
#
|
|
545
|
+
# @param newvalue [String] The admin group name you wish to remove from the admin group list
|
|
546
|
+
#
|
|
547
|
+
# @raise [JSS::InvalidDataError] If the value provided is not a String
|
|
548
|
+
# @raise [JSS::InvalidDataError] If the group provided is not in the admin_group array
|
|
549
|
+
#
|
|
550
|
+
# @return [Array <String>] An array of all the admin groups currently set.
|
|
551
|
+
def remove_admin_group(value)
|
|
552
|
+
raise JSS::InvalidDataError, 'Admin group being removed must be a string' unless value.is_a? String
|
|
553
|
+
raise JSS::InvalidDataError, "Admin group #{value} is not in the current admin group(s)." unless @admin_group.include? value
|
|
554
|
+
|
|
555
|
+
@admin_group.delete value
|
|
556
|
+
|
|
557
|
+
container&.should_update
|
|
558
|
+
|
|
559
|
+
@admin_group
|
|
560
|
+
end
|
|
561
|
+
|
|
562
|
+
# Return a REXML Element containing the current state of the DirectoryBindingType
|
|
563
|
+
# object for adding into the XML of the container.
|
|
564
|
+
#
|
|
565
|
+
# @author Tyler Morgan
|
|
566
|
+
#
|
|
567
|
+
# @return [REXML::Element]
|
|
568
|
+
def type_setting_xml
|
|
569
|
+
type_setting = REXML::Element.new 'admitmac'
|
|
570
|
+
type_setting.add_element('require_confirmation').text = @require_confirmation
|
|
571
|
+
type_setting.add_element('local_home').text = @local_home
|
|
572
|
+
type_setting.add_element('mount_style').text = @mount_style.downcase
|
|
573
|
+
type_setting.add_element('default_shell').text = @default_shell
|
|
574
|
+
type_setting.add_element('mount_network_home').text = @mount_network_home
|
|
575
|
+
type_setting.add_element('place_home_folders').text = @place_home_folders
|
|
576
|
+
type_setting.add_element('uid').text = @uid
|
|
577
|
+
type_setting.add_element('user_gid').text = @user_gid
|
|
578
|
+
type_setting.add_element('gid').text = @gid
|
|
579
|
+
type_setting.add_element('add_user_to_local').text = @add_user_to_local
|
|
580
|
+
type_setting.add_element('cached_credentials').text = @cached_credentials
|
|
581
|
+
type_setting.add_element('users_ou').text = @users_ou
|
|
582
|
+
type_setting.add_element('groups_ou').text = @groups_ou
|
|
583
|
+
type_setting.add_element('printers_ou').text = @printers_ou
|
|
584
|
+
type_setting.add_element('shared_folders_ou').text = @shared_folders_ou
|
|
585
|
+
type_setting.add_element('admin_group').text = @admin_group.join(',').to_s unless @admin_group.nil?
|
|
586
|
+
|
|
587
|
+
type_setting
|
|
588
|
+
end
|
|
522
589
|
|
|
523
590
|
end
|
|
524
591
|
|
|
525
|
-
end
|
|
592
|
+
end
|
|
593
|
+
|
|
594
|
+
end
|