Skip to content

Commit

Permalink
GrouperAPI: dict formatting #42
Browse files Browse the repository at this point in the history
return boolean
  • Loading branch information
astrochun committed Sep 18, 2020
1 parent 6a8b600 commit 168c006
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions requiam/grouper_admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,14 +160,13 @@ def add_privilege(self, access_group, target_group, target_group_type, privilege
raise Exception(f"Could NOT find access_group: {access_group}")

# initialize
params = {
'WsRestAssignGrouperPrivilegesLiteRequest': {
'allowed': 'T',
'subjectId': access_group_detail['uuid'],
'privilegeName': '',
'groupName': target_groupname,
'privilegeType': 'access'
}
params = dict()
params['WsRestAssignGrouperPrivilegesLiteRequest'] = {
'allowed': 'T',
'subjectId': access_group_detail['uuid'],
'privilegeName': '',
'groupName': target_groupname,
'privilegeType': 'access'
}

for privilege in privileges:
Expand All @@ -178,3 +177,5 @@ def add_privilege(self, access_group, target_group, target_group_type, privilege

if metadata['resultCode'] not in ['SUCCESS_ALLOWED', 'SUCCESS_ALLOWED_ALREADY_EXISTED']:
raise ValueError(f"Unexpected result received: {metadata['resultCode']}")

return True

0 comments on commit 168c006

Please sign in to comment.