TeamFoundationSecurityNamespace.CheckPermission Method (TeamFoundationRequestContext, IEnumerable<String>, Int32, Boolean, PermissionEvaluationCallback)

First checks to see whether the request context making the call is a SystemRequestContext and if it is, it returns immediately. Next, it queries the underlying permission store to determine whether the requestContext.UserContext has the requested permissions for the tokens and all its children. If alwaysAllowAdministrators is true and the UserContext is an admin on this server, the user will have permissions regardless of what the permission evaluation says. If the UserContext does not have the requestedPermissions for all of the children, a SecurityAccessException will be thrown.

Namespace:  Microsoft.TeamFoundation.Framework.Server
Assembly:  Microsoft.TeamFoundation.Framework.Server (in Microsoft.TeamFoundation.Framework.Server.dll)

Syntax

'Declaration
Public Sub CheckPermission ( _
    requestContext As TeamFoundationRequestContext, _
    tokens As IEnumerable(Of String), _
    requestedPermissions As Integer, _
    alwaysAllowAdministrators As Boolean, _
    permissionEvaluationCallback As PermissionEvaluationCallback _
)
public void CheckPermission(
    TeamFoundationRequestContext requestContext,
    IEnumerable<string> tokens,
    int requestedPermissions,
    bool alwaysAllowAdministrators,
    PermissionEvaluationCallback permissionEvaluationCallback
)
public:
void CheckPermission(
    TeamFoundationRequestContext^ requestContext, 
    IEnumerable<String^>^ tokens, 
    int requestedPermissions, 
    bool alwaysAllowAdministrators, 
    PermissionEvaluationCallback^ permissionEvaluationCallback
)
member CheckPermission : 
        requestContext:TeamFoundationRequestContext * 
        tokens:IEnumerable<string> * 
        requestedPermissions:int * 
        alwaysAllowAdministrators:bool * 
        permissionEvaluationCallback:PermissionEvaluationCallback -> unit
public function CheckPermission(
    requestContext : TeamFoundationRequestContext, 
    tokens : IEnumerable<String>, 
    requestedPermissions : int, 
    alwaysAllowAdministrators : boolean, 
    permissionEvaluationCallback : PermissionEvaluationCallback
)

Parameters

  • requestedPermissions
    Type: System.Int32

    The permissions to check for.

  • alwaysAllowAdministrators
    Type: System.Boolean

    If true and the UserContext is in the administrators group, the user will have permission regardless of what the permission evaluation says.

.NET Framework Security

See Also

Reference

TeamFoundationSecurityNamespace Class

CheckPermission Overload

Microsoft.TeamFoundation.Framework.Server Namespace