IsAuthorized Method
IIS 7.0
Retrieves a value indicating whether the specified principal is authorized for the specified configuration path.
Assembly: Microsoft.Web.Management (in Microsoft.Web.Management.dll)
public static bool IsAuthorized( IPrincipal principal, string configurationPath )
Parameters
- principal
- Type: System.Security.Principal..::..IPrincipal
A System.Security.Principal..::..IPrincipal interface that represents the security context of the user on whose behalf the code is running.
- configurationPath
- Type: System..::..String
The configuration path.
Return Value
Type: System..::..Booleantrue if the principal is authorized for the specified configuration path; otherwise, false.
| Exception | Condition |
|---|---|
| System..::..ArgumentNullException |
principal or configurationPath is nullNothingnullptrunita null reference (Nothing in Visual Basic). |
The following example demonstrates the IsAuthorized method. This code example is part of a larger example provided for the ManagementAuthorization class.
The following example sets the principal parameter to an object that enables you to check the Windows group membership of the current user.
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.