I'm currently using SharePoint online solution.
I've a list named "Projects" with the column "Title" and a column "People" (it's a people picker with multiple values).
I've already enabled a workflow that creates a new document library each time a new item is added in "Project" list. Also, this workflow breaks permission inheritance using SharePoint web services.
After this step, I would set new permissions (collaboration) to the created document library. I've tried using this HTTP call:
https://contoso.sharepoint.com/test/_api/web/lists/getByTitle('[%Current Item:Title%]')/roleassignments/addroleassignment(principalid=[%Current Item:People%],roleDefId=1073741827)
[%Current Item:People%] is set to return a list of IDs separated with semicolon.
It is currently not working. I guess is not possible to use the list of IDs.
So, should I have to iterate over "People" values in a loop? Then retrieve principal id for each user and then make the call to set permissions?
Is there any example to do this?