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 WebAppToWebAppAdditionalRoleRepository : BaseRepository<WebAppToWebAppAdditionalRole>
|
||||
{
|
||||
public WebAppToWebAppAdditionalRoleRepository(WebApiContext context) : base(context)
|
||||
private readonly LdapManager _ldapManager;
|
||||
|
||||
public WebAppToWebAppAdditionalRoleRepository(WebApiContext context, LdapManager ldapManager) : base(context)
|
||||
{
|
||||
_ldapManager = ldapManager;
|
||||
}
|
||||
|
||||
public async Task<List<WebAppToWebAppAdditionalRole>> GetListByFilterAsync(EmployeeToWebAppFilter filter, bool asNoTracking = true)
|
||||
@@ -60,8 +63,8 @@ namespace DAL.Repositories
|
||||
var groupSuffix = $"{webapp.AdWebAppName}_{webappRole.AdWebAppAdditionalRoleName}";
|
||||
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