Tuesday, December 18, 2007

"No access" site in MOSS2007

If you access a readlocked site.


1. This is by design: if you access an existing page, like /default.aspx or /_layouts/settings.aspx, you will get error message:

Access to this Web site has been blocked.
Please contact the administrator to resolve this problem.

In this condition, MOSS will check the permission on page first then throw the above error if the site is locked.

But if you access a folder, like / or /subsite or /doclib, you will get

403 FORBIDDEN

Or

404 NOT FOUND

In this condition, MOSS will check redirection function first, then throw the above error if the site is locked.

2.WSS/MOSS does not support custom error pages, the only customization can be made is for 404 (File not found error) on web application. You can check this:

SPWebApplication.FileNotFoundPage Property

http://msdn2.microsoft.com/en-gb/library/microsoft.sharepoint.administration.spwebapplication.filenotfoundpage.aspx

Windows SharePoint Services does not support the custom error pages that are typically used in IIS applications. There can only be one file per SharePoint Web application, which must be in HTML and cannot contain dynamic ASP.NET controls.

do whatever you want with Farm level administrators permissions.

SPSecurity.RunWithElevatedPrivileges(delegate()
{
// do whatever you want with Farm level administrators permissions.
}