views:

233

answers:

3

Has anybody experienced Sharepoint always returning true for rlAuthorizationModule.CheckUrlAccessForPrincipal even if the virtual path is not configured to allow anonymous access. Is there an alternative method to check for anon access in SharePoint?

A: 

Long shot, but two things you could check:

  • Is your virtual path inherriting anonymous access from a higher level path?
  • Are you checking the anonymous user or are you checking a user principle that has access?
Shiraz Bhaiji
I am doing the following: IPrincipal anonUser = new GenericPrincipal(new GenericIdentity(string.Empty, string.Empty), new string[0]); bool allowAnon = UrlAuthorizationModule.CheckUrlAccessForPrincipal(requestPath, anonUser, "get");It returns true for a page that is not configured to allow anonmyous access.
complexcipher
A: 

When anon access is enabled on Sharepoint for a site the method will always return true.

complexcipher
A: 

Security Note: If the UrlAuthorizationModule is not defined in the httpModules configuration section for the application, the UrlAuthorizationModule always returns true.

Please see the following url: http://authors.aspalliance.com/aspxtreme/sys/web/security/UrlAuthorizationModuleClassCheckUrlAccessForPrincipal.aspx

Nadav Yeheskel