In my SharePoint site collection (SharePoint Online), i mistakenly executed below code and it has messed up all the permissions, how to restore default set of permissions ?

   var web = context.get_web();
   if (!web.get_hasUniqueRoleAssignments()) {
         web.breakRoleInheritance(true, false);
  • did you check the site, if it just stop the inheritance and did not remove the user? if usres are over their just simply click on delete unique permissions. – Waqas Sarwar MVP Sep 29 '17 at 20:36

You can reset the role inheritance by using this code below :

var web = context.get_web();
   if (web.get_hasUniqueRoleAssignments()) {
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.