VersionControlServer.GetPermissions Method (array<String[], array<String[], RecursionType)

Gets all the permissions for one or more items in the Team Foundation Server database, for the specified users or groups. The permissions are returned in a string form for easier user display. It is not possible to parse or union these permissions to find a user's permissions to an item, because a user's permissions depend on what groups they are a member of. You can use the GetEffectivePermissions method to find permissions that are granted for this user.

Namespace:  Microsoft.TeamFoundation.VersionControl.Client
Assembly:  Microsoft.TeamFoundation.VersionControl.Client (in Microsoft.TeamFoundation.VersionControl.Client.dll)

Syntax

'Declaration
Public Function GetPermissions ( _
    identityNames As String(), _
    items As String(), _
    recursion As RecursionType _
) As ItemSecurity()
'Usage
Dim instance As VersionControlServer 
Dim identityNames As String()
Dim items As String()
Dim recursion As RecursionType 
Dim returnValue As ItemSecurity()

returnValue = instance.GetPermissions(identityNames, _
    items, recursion)
public ItemSecurity[] GetPermissions(
    string[] identityNames,
    string[] items,
    RecursionType recursion
)
public:
array<ItemSecurity^>^ GetPermissions(
    array<String^>^ identityNames, 
    array<String^>^ items, 
    RecursionType recursion
)
public function GetPermissions(
    identityNames : String[], 
    items : String[], 
    recursion : RecursionType
) : ItemSecurity[]

Parameters

  • identityNames
    Type: array<System.String[]

    The user or group names for which you want to get permissions.

    Pass null to match all users and groups who have permissions set for these items.

  • items
    Type: array<System.String[]

    The files or folders for which you want to get permissions. Each string may represent a Team Foundation Server path ($/CmdLine/parse.cs) or a local path (C:\Code\CmdLine\parse.cs), in the latter case, the local path is mapped to a server path via a workspace. If any string in the list is null, or refers to a deleted item or an old version of an item, an exception occurs.

  • recursion
    Type: Microsoft.TeamFoundation.VersionControl.Client.RecursionType

    The recursion parameter determines what files and folders you want to get. RecursionType.None examines the passed items only; if you passed in $/CmdLine then you will get permissions for the folder $/CmdLine. RecursionType.OneLevel examines the passed items and, in the case of folders, their children: if you passed in $/CmdLine you will get permissions for the files and folders directly inside that folder.

    RecursionType.Full examines the full tree; if you passed in $/CmdLine/parser.cs you will get all files called parser.cs inside $/CmdLine or any folder under it.

Return Value

Type: array<Microsoft.TeamFoundation.VersionControl.Client.ItemSecurity[]
Each ItemSecurity object in the returned array contains a string that indicates what item it is ($/CmdLine): a Boolean variable that indicates whether this item inherits permission from its parent folders; a Boolean variable that indicates whether the current user has permission to set permissions on this item; and an array of AccessEntry objects. These objects will contain strings that indicate whether allow and deny permissions are set for different users. Each ItemSecurity object corresponds to one file or folder and each AccessEntry object refers to one user's permission to that item.

.NET Framework Security

See Also

Reference

VersionControlServer Class

VersionControlServer Members

GetPermissions Overload

Microsoft.TeamFoundation.VersionControl.Client Namespace