@@ -149,43 +149,37 @@ func addPermsSchema(s map[string]*schema.Schema) map[string]*schema.Schema {
149
149
Default : false ,
150
150
DiffSuppressFunc : suppressPermissionDiff ,
151
151
}
152
- s ["monitoring_view_jobs " ] = & schema.Schema {
152
+ s ["monitoring_create_jobs " ] = & schema.Schema {
153
153
Type : schema .TypeBool ,
154
154
Optional : true ,
155
155
Default : false ,
156
156
DiffSuppressFunc : suppressPermissionDiff ,
157
157
}
158
- s ["security_manage_global_2fa" ] = & schema.Schema {
159
- Type : schema .TypeBool ,
160
- Optional : true ,
161
- Default : true ,
162
- DiffSuppressFunc : suppressPermissionDiff ,
163
- }
164
- s ["security_manage_active_directory" ] = & schema.Schema {
158
+ s ["monitoring_update_jobs" ] = & schema.Schema {
165
159
Type : schema .TypeBool ,
166
160
Optional : true ,
167
- Default : true ,
161
+ Default : false ,
168
162
DiffSuppressFunc : suppressPermissionDiff ,
169
163
}
170
- s ["dhcp_manage_dhcp " ] = & schema.Schema {
164
+ s ["monitoring_delete_jobs " ] = & schema.Schema {
171
165
Type : schema .TypeBool ,
172
166
Optional : true ,
173
- Default : true ,
167
+ Default : false ,
174
168
DiffSuppressFunc : suppressPermissionDiff ,
175
169
}
176
- s ["dhcp_view_dhcp " ] = & schema.Schema {
170
+ s ["monitoring_view_jobs " ] = & schema.Schema {
177
171
Type : schema .TypeBool ,
178
172
Optional : true ,
179
- Default : true ,
173
+ Default : false ,
180
174
DiffSuppressFunc : suppressPermissionDiff ,
181
175
}
182
- s ["ipam_manage_ipam " ] = & schema.Schema {
176
+ s ["security_manage_global_2fa " ] = & schema.Schema {
183
177
Type : schema .TypeBool ,
184
178
Optional : true ,
185
179
Default : true ,
186
180
DiffSuppressFunc : suppressPermissionDiff ,
187
181
}
188
- s ["ipam_view_ipam " ] = & schema.Schema {
182
+ s ["security_manage_active_directory " ] = & schema.Schema {
189
183
Type : schema .TypeBool ,
190
184
Optional : true ,
191
185
Default : true ,
@@ -248,19 +242,14 @@ func permissionsToResourceData(d *schema.ResourceData, permissions account.Permi
248
242
d .Set ("account_manage_ip_whitelist" , permissions .Account .ManageIPWhitelist )
249
243
d .Set ("monitoring_manage_lists" , permissions .Monitoring .ManageLists )
250
244
d .Set ("monitoring_manage_jobs" , permissions .Monitoring .ManageJobs )
245
+ d .Set ("monitoring_create_jobs" , permissions .Monitoring .CreateJobs )
246
+ d .Set ("monitoring_update_jobs" , permissions .Monitoring .UpdateJobs )
247
+ d .Set ("monitoring_delete_jobs" , permissions .Monitoring .DeleteJobs )
251
248
d .Set ("monitoring_view_jobs" , permissions .Monitoring .ViewJobs )
252
249
if permissions .Security != nil {
253
250
d .Set ("security_manage_global_2fa" , permissions .Security .ManageGlobal2FA )
254
251
d .Set ("security_manage_active_directory" , permissions .Security .ManageActiveDirectory )
255
252
}
256
- if permissions .DHCP != nil {
257
- d .Set ("dhcp_manage_dhcp" , permissions .DHCP .ManageDHCP )
258
- d .Set ("dhcp_view_dhcp" , permissions .DHCP .ViewDHCP )
259
- }
260
- if permissions .IPAM != nil {
261
- d .Set ("ipam_manage_ipam" , permissions .IPAM .ManageIPAM )
262
- d .Set ("ipam_view_ipam" , permissions .IPAM .ViewIPAM )
263
- }
264
253
if permissions .DNS .RecordsAllow != nil {
265
254
d .Set ("dns_records_allow" , dnsRecordsACLtoSchema (permissions .DNS .RecordsAllow ))
266
255
}
@@ -351,6 +340,15 @@ func resourceDataToPermissions(d *schema.ResourceData) account.PermissionsMap {
351
340
if v , ok := d .GetOk ("monitoring_manage_jobs" ); ok {
352
341
p .Monitoring .ManageJobs = v .(bool )
353
342
}
343
+ if v , ok := d .GetOk ("monitoring_create_jobs" ); ok {
344
+ p .Monitoring .CreateJobs = v .(bool )
345
+ }
346
+ if v , ok := d .GetOk ("monitoring_update_jobs" ); ok {
347
+ p .Monitoring .UpdateJobs = v .(bool )
348
+ }
349
+ if v , ok := d .GetOk ("monitoring_delete_jobs" ); ok {
350
+ p .Monitoring .DeleteJobs = v .(bool )
351
+ }
354
352
if v , ok := d .GetOk ("monitoring_view_jobs" ); ok {
355
353
p .Monitoring .ViewJobs = v .(bool )
356
354
}
@@ -363,30 +361,6 @@ func resourceDataToPermissions(d *schema.ResourceData) account.PermissionsMap {
363
361
if v , ok := d .GetOk ("security_manage_active_directory" ); ok {
364
362
p .Security .ManageActiveDirectory = v .(bool )
365
363
}
366
- for _ , thing := range []string {"dhcp_manage_dhcp" , "dhcp_view_dhcp" } {
367
- _ , ok := d .GetOkExists (thing )
368
- if d .HasChange (thing ) || ok {
369
- p .DHCP = & account.PermissionsDHCP {}
370
- }
371
- }
372
- if v , ok := d .GetOk ("dhcp_manage_dhcp" ); ok {
373
- p .DHCP .ManageDHCP = v .(bool )
374
- }
375
- if v , ok := d .GetOk ("dhcp_view_dhcp" ); ok {
376
- p .DHCP .ViewDHCP = v .(bool )
377
- }
378
- for _ , thing := range []string {"ipam_manage_ipam" , "ipam_view_ipam" } {
379
- _ , ok := d .GetOkExists (thing )
380
- if d .HasChange (thing ) || ok {
381
- p .IPAM = & account.PermissionsIPAM {}
382
- }
383
- }
384
- if v , ok := d .GetOk ("ipam_manage_ipam" ); ok {
385
- p .IPAM .ManageIPAM = v .(bool )
386
- }
387
- if v , ok := d .GetOk ("ipam_view_ipam" ); ok {
388
- p .IPAM .ViewIPAM = v .(bool )
389
- }
390
364
return p
391
365
}
392
366
0 commit comments