Python SDK - Add Group Admin membership with 'configurable_permissions=None'
AnsweredHello,
*Using Python 3.7.3 and latest boxsdk==2.3.2
Problem: I am attempting to add a managed user as 'Group Admin' member and ensure that they have no additional configurable permissions.
Right now I am passing configurable_permission=None but it is not setting the permissions to Null.
try:
user = sa_client.user(boxUserId)
role='admin'
membership = sa_client.group(group_id=groupID).add_member(user, role, configurable_permissions=None)
membershipID = membership.id
pr('- Group Membership ID: ' + membershipID)
pr('- Added {0} to the {1} group!'.format(
membership.user.name, membership.group.name))
When I inspect the users Group Admin permissions they have everything selected.
using Postman to return the group membership confirms all values are set to 'true' instead of 'false' for each of the settings. Do I need to make a subsequent update of membership API request and pass a dict of false / null values for each setting?
...
"group": {
"type": "group",
"id":***phone number removed for privacy***",
"name": "PS-P1-Shared",
"group_type": "managed_group"
},
"role": "admin",
"configurable_permissions": {
"can_create_accounts": true,
"can_edit_accounts": true,
"can_instant_login": true,
"can_run_reports": true
},
...
}
Many Thanks,
Peter
-
Hey
Thanks for raising this issue -- it looks like you opened an issue on the GitHub repo as well. A fix for this has been merged into the python SDK master branch, but a new release has not been cut yet.
In order to use the updated code, you use
pip install git+https://github.com/box/box-python-sdk.git
I'd recommend checking the commit history before updating as there may be other changes which affect your existing code.
Let us know if you have any further issues! -
-- it looks the same as what you're reporting. The problem, as I understand it, is that the "none" option was being treated as the default setting (all of the configurable permissions). You can review the opened issue here.
-
True, they are related issues in that they both need to send 'None' value ...but one was for shared link endpoint and this one is for group permissions. I will need to test if the latest commit will change the behaviour of both issues and if needed log the group one separately
Thanks,
Peter
-
Hi ,
I tested this again today with most recent version [boxsdk==2.4.1] and still experiencing the same outcome.
I have logged a specific issue [432] relating to the group admin case on the python SDK for review.
Thanks,
Peter
-
This issue has now been resolved with sdk latest release (v. 2.5.0) thanks to @Cary Cheng!
Please sign in to leave a comment.
Comments
7 comments