Thursday, March 26, 2009

"Access Denied" MOSS 2007

I got this error while playing with the multiple authentication ie. authenticating sharepoint application with third party LDAP and Active Directory.
I was able to log in to home page but any system page e.g. _layouts/settings.aspx threw the "Access Denied " error.

This is how i got it working :

1) Go to "Application Management" tab in Central Administration
2) Click on the "Policy of Web application " link under "Application Security" section
3) Add the following users :
  • - NT AUTHORITY\local service (Full Control)
  • - "Site Collection Administrator" (Full Control)

Monday, March 09, 2009

Get all Custom Site Templates from Site collection

using (SPSite newSite = new SPSite(SiteURL))
{
using (SPWeb newWeb = newSite.OpenWeb())
{
SPWebTemplateCollection customTempCollection = newSite.GetCustomWebTemplates((uint)newWeb.Locale.LCID);
}
}

Thursday, March 05, 2009

Unable to add selected web part(s).

ERROR:
Assemblies that implement ASP.NET Web Parts and are installed into a partially trusted location, such as the bin directory, must be compiled with the AllowPartiallyTrustedCallersAttribute set for import to succeed.

SOLUTION:
Add [assembly:AllowPartiallyTrustedCallers] to AssemblyInfo.cs

REFER :
http://msdn.microsoft.com/en-us/library/system.security.allowpartiallytrustedcallersattribute(VS.71).aspx