Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

We need to avoid our users, who are "site owners", delete his site collection by mistake.

The only method I think of is use Jquery to hide/disable the "Delete this site" button. Do we have other way to do so? For example disable the delete site permission. Thanks.

Mark

share|improve this question
add comment

2 Answers 2

A WebDeleting event can be used to prevent users event if they are owners to delete a site collection. Example:

public override void WebDeleting(SPWebEventProperties properties)
{
    properties.Status = SPEventReceiverStatus.CancelWithError;
    properties.ErrorMessage = "This site cannot be deleted.";
    properties.Cancel = true;
}

See this for more info: http://blogs.technet.com/b/sharepointdevelopersupport/archive/2012/09/07/how-to-prevent-site-deletion-with-a-custom-event-receiver.aspx

share|improve this answer
add comment

Other option is to create a HideCustomAction to hide the "Delete a site" action.

<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <HideCustomAction
    Id="Customization"
    GroupId = "SiteTasks"
    HideActionId = "DeleteWeb"
    Location = "Microsoft.SharePoint.SiteSettings">
 </HideCustomAction>
</Elements>

For a list of locations MSDN

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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