feat: LdapOptions erstellt anstelle statischer (fest codierter) Konfigurationswerte, LdapOptions und Abhängigkeitsinjektionen dafür hinzugefügt
This commit is contained in:
@@ -12,8 +12,11 @@ namespace DAL.Repositories
|
||||
{
|
||||
public class WebAppToDepartmentRepository : BaseRepository<WebAppToDepartment>
|
||||
{
|
||||
public WebAppToDepartmentRepository(WebApiContext context) : base(context)
|
||||
private readonly LdapManager _ldapManager;
|
||||
|
||||
public WebAppToDepartmentRepository(WebApiContext context, LdapManager ldapManager) : base(context)
|
||||
{
|
||||
_ldapManager = ldapManager;
|
||||
}
|
||||
|
||||
public async Task<List<WebAppToDepartment>> GetListByFilterAsync(EmployeeToWebAppFilter filter, bool asNoTracking = true)
|
||||
@@ -59,11 +62,11 @@ namespace DAL.Repositories
|
||||
var isAdding = action == "adding";
|
||||
|
||||
var groupSuffix = $"{webapp.AdWebAppName}_{department.AdGroupDepartmentName}";
|
||||
if (!LdapManager.IsWindreamSuffixGroup(groupSuffix)) return true;
|
||||
if (!_ldapManager.IsWindreamSuffixGroup(groupSuffix)) return true;
|
||||
try
|
||||
{
|
||||
if (isAdding) result = LdapManager.AD_AddUserloginToGroup(employee.LoginName, groupSuffix);
|
||||
else result = LdapManager.AD_RemoveUserFromGroup(employee.LoginName, groupSuffix);
|
||||
if (isAdding) result = _ldapManager.AD_AddUserloginToGroup(employee.LoginName, groupSuffix);
|
||||
else result = _ldapManager.AD_RemoveUserFromGroup(employee.LoginName, groupSuffix);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user