0

I've created this function to delete a user from my site collection.

function removeUserFromSite(){
  userHTML = $('#my_SiteUsers option:selected').text();
  //check if default user selected  alert(user);
  if(user!="default"){
    var removeConfirm = confirm("You are about to delete "+userHTML+" from SharePoint. Are you sure?");
    if(removeConfirm){
      $().SPServices({
        operation:"RemoveUserFromSite",
        userLoginName: user,
        async:true
      });
    }
  }else{
    alert("Please select a user");
  }
}

Error I get in firebug: This operation is available only for a web with unique permissions

I don't understand why I get this if I'm deleting from the Site Collection, what could the collection be inhering from?

1 Answer 1

1

We've discussed this in the SPServices discussions. It's not a good idea to delete users from a Site Collection even if you could.

From my reply on the thread above:

Think about the instances where the user created or modified content. All of a sudden that content will have no Author or Editor. In some instances, you will even get the dreaded "An unexpected error has occurred".

Managing permissions is the way to go, even if it is painful. Avoid the pain by managing permissions wisely as you go along.

1
  • Hey Marc, yea I've sense moved around from trying to do this. I'm probably going to start working on a way to find users who aren't in groups. At least that way I can clean things up. If you have any tips for that, that would be great. Thanks for the reply.
    – Batman
    Oct 11, 2013 at 19:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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