phpSPO
phpSPO copied to clipboard
how to add a user to a directory in sharepoint
Hello,
I'd like to use phpSPO to create a directory in one of my teams sites, and then allow certain users to be able to edit it. I understand that I need to do two things (after creating the directory, which is straighforward):
- interrupt the role inheritance with something like this: $folderItem->breakRoleInheritance(true)->executeQuery();
- and then add the new roles for the users I want to add. I believe that to do so I need to use something like the method "setHasUniqueRoleAssignments" - but I'm not quite sure how, and how to add users (the ones I want to add) and mode (read or edit). How do I do this?
in future, I will also want to remove users as needed - how do I achieve this?
thanks in advance for your answers ciao Simone