Break sub-site permission inheritance with a workflow
-
08-02-2021 - |
Question
I have a SP workflow that creates a new project subsite upon a new project being created in the master list but cannot see how to break the permissions inheritance from the Parent site.
Each project subsite is required to have a specific user group access requirement in addition to others that can view all subsites. I have found multiple sources of how to break / set permissions for Items eg lists, document libraries and documents but not how to control the sub site itself.
I assume it will be some form REST api command but cannot figure it out. Any help gratefully received
No correct solution
OTHER TIPS
The rest api is like this:
http://sp/sites/parentsite/subsite/_api/web/breakroleinheritance(copyRoleAssignments=true, clearSubscopes=true)
Besides, you need to change the app's permission Request XML. The scope should be site collection level:
<AppPermissionRequests AllowAppOnlyPolicy="true">
<AppPermissionRequest Scope="http://sharepoint/content/sitecollection" Right="FullControl" />
</AppPermissionRequests>
Otherwise, the workflow would not have permissions on the subsite.