The SiteAccessChecker class helps check the security on a site.
The following table shows the constructors of the SiteAccessChecker class and a brief description of each.
|SiteAccessChecker||Initializes a new instance of the SiteAccessChecker class.|
The following table shows the methods of the SiteAccessChecker class and a brief description of each.
|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.|
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.
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.
Platforms: Microsoft Windows Server 2003
Assembly: Microsoft.SharePoint.Portal (in Microsoft.SharePoint.Portal.dll)
Security: Code Access Security