Office365-REST-Python-Client
Office365-REST-Python-Client copied to clipboard
Granting user from client_people_picker access using add_role_assignment
Hi,
I'm trying to programmatically create a file in my Sharepoint site and enable access to an arbitrary user from my Enterprise. When querying for a via
ctx = ClientContext(...)
user = ctx.web.site_users.get_by_email(user_email)
target_file.listItemAllFields.add_role_assignment(user, role_def).execute_query()
It appears that not all the users that are available in the web interface are available in the web site_users query. I can however find all the users using the client_people_picker_search_user API.
Is there a way to pass the found user from the people picker user search API into the add_role_assignments call?