SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have an internet site using MOSS 2007/win 2008/SQL 2005. Users are authenticated using forms authentication.

All authenticated users are able to browse pages like: /Style%20Library/Forms/AllItems.aspx or _layouts/viewlsts.apsx

They can view XSL files and even download a copy of it.

How can I restrict users from accessing these pages without affecting their browsing experience?

Note: I have activated the ViewFormPagesLockdown feature and made sure anonymous users are not able to access these pages.

share|improve this question

As you say ViewFormPagesLockdown affects anonymous users only. What the feature really does is remove ViewFormPages right from Limited Access role:

SPRoleDefinition guest = mySite.RootWeb.RoleDefinitions.GetByType(SPRoleType.Guest);
guest.BasePermissions &= ~(SPBasePermissions.EmptyMask | SPBasePermissions.ViewFormPages);
guest.BasePermissions &= ~SPBasePermissions.UseRemoteAPIs;

You could use the same code to remove these permissions for the role types you dont want this access to.

share|improve this answer
you mean i need to create an EXE for example that does this action and run it against the sites that need to be secured? – Emad Mar 1 '10 at 11:44
i would probably go for a call-out (feature receiver) that modified the role. This gives you both better provisioning and the possibility to reset the rights on feature deactivation: guest.BasePermissions |= SPBasePermissions.EmptyMask | SPBasePermissions.ViewFormPages; guest.BasePermissions |= SPBasePermissions.UseRemoteAPIs; what you will need to determine first though is what SPRoleType you want to revoke these permissions from... – Anders Rask Mar 1 '10 at 13:10

Your Answer


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.