While doing some research on how to disable access to the application and from pages for anonymous users in SharePoint 2010, I came across an interesting feature, the “ViewFormPagesLockdown” feature. This feature when enabled will disallow anonymous users access to application and form pages (allitems.aspx, newforms.aspx etc.) while allowing access to read and download the content from the list and document libraries.
The feature is available in SharePoint 2007, SharePoint Foundation 2010 and SharePoint Server 2010 and not available in WSS. This feature is available on only those sites that have been created using the Publishing Portal template.
The feature is enabled by default on a site created using Publishing Portal template. This is a hidden feature and can only be enabled or disabled using STSADM tool in SharePoint 2007 and PowerShell in SharePoint 2010.
To enable the feature run the following command
Enable-SPFeature –identity "feature name" -URL http://site
Note – You can use the GUID instead of feature name as well.
To disable the feature
It’s a 2 step process to disable the feature
- Get the feature object in a variable using the following command
$feature = get-spfeature viewformpageslockdown
- Run the disable feature command
disable-spfeature $feature -url http://site
To enable the feature run the following stsadm command
stsadm -o activatefeature -url "site url" -filename ViewFormPagesLockDown\feature.xml
To disable the feature run the following stsadm command
stsadm -o deactivatefeature -url "site url" -filename ViewFormPagesLockDown\feature.xml
For more information please refer to the following links