Delen via


TeamFoundationSecurityNamespace.HasPermissionForAnyChildren Method (TeamFoundationRequestContext, String, Int32, Boolean, 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 this token or any one of its children. If alwaysAllowAdministrators is true and the UserContext is an admin on this host, the user will have permissions regardless of what the permission evaluation says. If the UserContext does not have the requestedPermissions for any of the children, false will be returned.

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

Syntax

'Declaration
Public Function HasPermissionForAnyChildren ( _
    requestContext As TeamFoundationRequestContext, _
    token As String, _
    requestedPermissions As Integer, _
    resultIfNoChildrenFound As Boolean, _
    alwaysAllowAdministrators As Boolean, _
    permissionEvaluationCallback As PermissionEvaluationCallback _
) As Boolean
public bool HasPermissionForAnyChildren(
    TeamFoundationRequestContext requestContext,
    string token,
    int requestedPermissions,
    bool resultIfNoChildrenFound,
    bool alwaysAllowAdministrators,
    PermissionEvaluationCallback permissionEvaluationCallback
)
public:
bool HasPermissionForAnyChildren(
    TeamFoundationRequestContext^ requestContext, 
    String^ token, 
    int requestedPermissions, 
    bool resultIfNoChildrenFound, 
    bool alwaysAllowAdministrators, 
    PermissionEvaluationCallback^ permissionEvaluationCallback
)
member HasPermissionForAnyChildren : 
        requestContext:TeamFoundationRequestContext * 
        token:string * 
        requestedPermissions:int * 
        resultIfNoChildrenFound:bool * 
        alwaysAllowAdministrators:bool * 
        permissionEvaluationCallback:PermissionEvaluationCallback -> bool
public function HasPermissionForAnyChildren(
    requestContext : TeamFoundationRequestContext, 
    token : String, 
    requestedPermissions : int, 
    resultIfNoChildrenFound : boolean, 
    alwaysAllowAdministrators : boolean, 
    permissionEvaluationCallback : PermissionEvaluationCallback
) : boolean

Parameters

  • token
    Type: System.String

    The token the permissions are being checked on.

  • requestedPermissions
    Type: System.Int32

    The permissions to check for.

  • resultIfNoChildrenFound
    Type: System.Boolean

    In the case where no children are found this is the value that will be returned. Since hierarchical namespaces are sparse, children for the token might exist but do not have permissions set on them and therefore the security service will not see them.

  • alwaysAllowAdministrators
    Type: System.Boolean

    If true and the UserContext is an admin on this host, the user will have permission regardless of what the permission evaluation says.

Return Value

Type: System.Boolean
True if the user has the permissions for any of the requested children, false otherwise.

.NET Framework Security

See Also

Reference

TeamFoundationSecurityNamespace Class

HasPermissionForAnyChildren Overload

Microsoft.TeamFoundation.Framework.Server Namespace