次の方法で共有


SPSecurity.SuppressAccessDeniedRedirectInScope class

Suppresses the automatic redirect when an UnauthorizedException is thrown within the using scope.

Inheritance hierarchy

System.Object
  Microsoft.SharePoint.SPSecurity.SuppressAccessDeniedRedirectInScope

Namespace:  Microsoft.SharePoint
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)

Syntax

'Declaration
Public Class SuppressAccessDeniedRedirectInScope _
    Implements IDisposable
'Usage
Dim instance As SPSecurity.SuppressAccessDeniedRedirectInScope
public class SuppressAccessDeniedRedirectInScope : IDisposable

Remarks

When an UnauthorizedException is thrown, the default behavior of Microsoft SharePoint Foundation is to automatically redirect to accessDenied.aspx or return an HTTP 401 response, depending on whether the user is authenticated or not authenticated. This behavior may not be desirable in certain scenarios, for example, where the calling program should handle the UnauthorizedException.

Thread safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See also

Reference

SPSecurity.SuppressAccessDeniedRedirectInScope members

Microsoft.SharePoint namespace