Partager via


ISecurityNamespaceExtension.HasPermission Method

This will be called every time that a permission decision is being made and allows the implementor to override the preliminary decision. Note, if a PermissionEvaluationCallback is provided to the function, it will override this decision.

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

Syntax

'Declaration
Function HasPermission ( _
    requestContext As TeamFoundationRequestContext, _
    token As String, _
    requestedPermissions As Integer, _
    effectiveAllows As Integer, _
    effectiveDenys As Integer, _
    preliminaryDecision As Boolean _
) As Boolean
bool HasPermission(
    TeamFoundationRequestContext requestContext,
    string token,
    int requestedPermissions,
    int effectiveAllows,
    int effectiveDenys,
    bool preliminaryDecision
)
bool HasPermission(
    TeamFoundationRequestContext^ requestContext, 
    String^ token, 
    int requestedPermissions, 
    int effectiveAllows, 
    int effectiveDenys, 
    bool preliminaryDecision
)
abstract HasPermission : 
        requestContext:TeamFoundationRequestContext * 
        token:string * 
        requestedPermissions:int * 
        effectiveAllows:int * 
        effectiveDenys:int * 
        preliminaryDecision:bool -> bool
function HasPermission(
    requestContext : TeamFoundationRequestContext, 
    token : String, 
    requestedPermissions : int, 
    effectiveAllows : int, 
    effectiveDenys : int, 
    preliminaryDecision : boolean
) : boolean

Parameters

  • token
    Type: System.String

    The token the permissions are currently being evaluated on.

  • requestedPermissions
    Type: System.Int32

    The permissions being requested.

  • effectiveAllows
    Type: System.Int32

    The granted permissions the securityNamespace evaluated for this user on this token.

  • effectiveDenys
    Type: System.Int32

    The permissions that were explicitly denied to the user due to a setting on the current token, a parent token or because of group membership.

  • preliminaryDecision
    Type: System.Boolean

    The answer we would provide if the callback were not used.

Return Value

Type: System.Boolean
True if the user should have the permission, false otherwise.
This value will always trump the premilinaryDecision.

.NET Framework Security

See Also

Reference

ISecurityNamespaceExtension Interface

Microsoft.TeamFoundation.Framework.Server Namespace