Hide the “SharePoint Designer Settings” link in the Site Collection Settings Programmatically

Relates to: SharePoint  2010, SharePoint Designer

Sometimes you want to hide the “SharePoint Designer Settings” link in the Site Collection Settings to prevent new users from discovering it and playing around with it. To hide this link, you need to create a feature scoped at the site collection. In the Elements.xml file, you can hide the custom action for the SharePoint Designer settings:

<?xml version=”1.0″ encoding=”utf-8″?>

<Elements xmlns=”http://schemas.microsoft.com/sharepoint/“>

<HideCustomAction

GroupId =”SiteCollectionAdmin”

HideActionId =”SharePointDesignerSettings”

Id =”HideSharePointDesignerSettings”

Location =”Microsoft.SharePoint.SiteSettings”>

</HideCustomAction>

</Elements>

If you also want to set the site collection SharePoint Designer settings programmatically, you should check out this post.

Advertisements

Set SharePoint Designer 2010 Settings Programmatically

Relates to: SharePoint  2010, SharePoint Designer

Once you’ve set the look and feel of a site, chances are you want to prevent users from using SharePoint Designer to change that look and feel. Luckily you can set the SharePoint Designer 2010 settings, either programmatically or through the user interface. In SharePoint 2010, you can access the SharePoint Designer 2010 settings from the user interface  either through the site collection’s settings or the url: http://%5BsiteCollectionUrl%5D/_layouts/SharePointDesignerSettings.aspx:

If you want to set these settings programmatically, you’ll need to create a feature receiver scoped at the site collection that will restrict the site collection’s SharePoint Designer settings when the feature is activated. In the FeatureActivated method, get the site collection and change the settings:

SPSite cSite = properties.Feature.Parent as SPSite;

cSite.AllowDesigner = false; // enable SharePoint Designer

cSite.AllowRevertFromTemplate = false; //detach pages

cSite.AllowMasterPageEditing = false; //customize master pages and page layouts

cSite.ShowURLStructure = false; //see hidden url structure

cSite.RootWeb.Update();

*It’s important to note that the site collection SharePoint Designer settings only apply to the site owners and designers — a site collection administrator would still be able to use SharePoint Designer on the site collection even when all the settings are set to false.

You can go one step further and staple this feature to the specific site templates (ie. Global or STS#1) so that the feature is automatically activated when a site based on that site template is created.

You can also hide the “SharePoint Designer Settings” link in the Site Collection settings to make it less likely for users to stumble upon the option (although users would still be able to access it via the url).

If you want to restrict the SharePoint Designer settings for all the site collections within the web application, its easier to set these SharePoint Designer settings for the web application instead of for each site collection within the web application.

Change the SharePoint Designer 2010 Settings from the UI

Relates to: SharePoint  2010, SharePoint Designer

In SharePoint 2010, you can now set the SharePoint Designer settings for a web application or a site collection from the UI.

Steps to access the Web Application SharePoint Designer Settings:

  1. In Central Administration, click Application Management
  2. Under the Web Applications heading, click Manage web applications
  3. Select the web application and then in the Web Applications tab of the ribbon, click General Settings > SharePoint Designer

SharePoint Designer Settings for Web Application

4. From the SharePoint Designer Settings you can specify whether to enable SharePoint Designer and what can be customized using SharePoint Designer for all users:

SharePoint Designer Settings Web Application

Steps to access the Site Collection SharePoint Designer Settings:

  1. From the site collection, click Site Actions > Site Settings
  2. If you are a site collection administrator, you will see the Site Collection Administration column on the right side — under this column click on SharePoint Designer Settings

4. From the SharePoint Designer Settings you can set the ability for Site Owners and Designers  to use SharePoint Designer and what they can customize using SharePoint Designer. It’s important to note that even when all the options are unchecked, a Site Collection Administrator can STILL use SharePoint Designer on the site collection.

Conclusion:

You can set the SharePoint Designer settings for an entire web application or an entire site collection. If you want to know how to set these settings programmatically, you should check out this blog post.