Skip to content

Commit 1ae8c18

Browse files
Job ACLs for service principals
1 parent 4583670 commit 1ae8c18

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

dbclient/dbclient.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,12 @@ def http_req(self, http_type, endpoint, json_params, version='2.0', print_json=F
277277
'json': json_params,
278278
}
279279
else:
280+
logging.error({
281+
'http_status_code': raw_results.status_code,
282+
'error': raw_results.text,
283+
'url': full_endpoint,
284+
'json': json_params,
285+
})
280286
raise Exception(message)
281287
results = raw_results.json()
282288
if logging_utils.check_error(results):
@@ -344,6 +350,11 @@ def build_acl_args(self, full_acl_list, is_jobs=False):
344350
'permission_level': permissions})
345351
if permissions == 'IS_OWNER':
346352
current_owner = member.get('user_name')
353+
elif 'service_principal_name' in member:
354+
acls_list.append({'service_principal_name': member.get('service_principal_name'),
355+
'permission_level': permissions})
356+
if permissions == 'IS_OWNER':
357+
current_owner = member.get('service_principal_name')
347358
else:
348359
if member.get('group_name') != 'admins':
349360
acls_list.append({'group_name': member.get('group_name'),

0 commit comments

Comments
 (0)