Skip to content

Commit cead2df

Browse files
committed
Refactor user group name handling in TfsUserMappingTool
Replaced hardcoded "Project Collection Valid Users" string in `TfsUserMappingTool.cs` with a configurable property `Options.ProjectCollectionValidUsersGroupName`. Added this property to `TfsUserMappingToolOptions.cs` to allow customization of the group name, with a default value of "Project Collection Valid Users".
1 parent fdae325 commit cead2df

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/MigrationTools.Clients.TfsObjectModel/Tools/TfsUserMappingTool.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ private Dictionary<string, string> GetMappingFileData()
121121

122122
private List<IdentityItemData> GetUsersListFromServer(IGroupSecurityService gss)
123123
{
124-
Identity allIdentities = gss.ReadIdentity(SearchFactor.AccountName, "Project Collection Valid Users", QueryMembership.Expanded);
124+
Identity allIdentities = gss.ReadIdentity(SearchFactor.AccountName, Options.ProjectCollectionValidUsersGroupName, QueryMembership.Expanded);
125125
Log.LogInformation("TfsUserMappingTool::GetUsersListFromServer Found {count} identities (users and groups) in server.", allIdentities.Members.Length);
126126

127127
List<IdentityItemData> foundUsers = new List<IdentityItemData>();

src/MigrationTools.Clients.TfsObjectModel/Tools/TfsUserMappingToolOptions.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,12 @@ public class TfsUserMappingToolOptions : ToolOptions, ITfsUserMappingToolOptions
3131
/// </summary>
3232
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)]
3333
public bool SkipValidateAllUsersExistOrAreMapped { get; set; } = false;
34+
35+
/// <summary>
36+
/// This is the regionalized "Project Collection Valid Users" group name. Default is "Project Collection Valid Users".
37+
/// </summary>
38+
public string ProjectCollectionValidUsersGroupName { get; set; } = "Project Collection Valid Users";
39+
3440
}
3541

3642
public interface ITfsUserMappingToolOptions

0 commit comments

Comments
 (0)