SiteAccessChecker Class

The SiteAccessChecker class helps check the security on a site.

System.Object

   Microsoft.SharePoint.Portal.Security.SiteAccessChecker

Public Constructors

The following table shows the constructors of the SiteAccessChecker class and a brief description of each.

Name Description
SiteAccessChecker Initializes a new instance of the SiteAccessChecker class.

Public Methods

The following table shows the methods of the SiteAccessChecker class and a brief description of each.

Name Description
Demand Throws an exception if the user does not have the right that is specified.
GetMaxPrivilege Returns the maximum privilege available on the site for the user.
DemandSiteRightByName Throws an exception if the specified user does not have the right that is specified.
DemandSiteRightBySID Throws an exception if the user represented by the specified security identifier (SID) does not have the right that is specified.

Example

The following example shows how to use the SiteAccessChecker object and its methods. The DemandSiteRightByName method will throw an exception if the specified user ("Dan Wilson") does not have the specified right (Create Category) on the portal site.

Thread Safety

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

Requirements

Namespace: Microsoft.SharePoint.Portal.Security

Platforms: Microsoft Windows Server 2003

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

Security: Code Access Security