Optimise for quick AD user searching

Avoids loading users groups when not needed
This commit is contained in:
Gary Sharp
2014-04-17 15:49:22 +10:00
parent b77bdf16f5
commit 36100bfef5
8 changed files with 55 additions and 26 deletions
@@ -29,7 +29,7 @@ namespace Disco.Web.Areas.Config.Controllers
var token = JobQueueToken.FromJobQueue(jq);
var subjects = token.SubjectIds == null ? new List<Models.JobQueue.ShowModel.SubjectDescriptor>() :
token.SubjectIds.Select(subjectId => ActiveDirectory.RetrieveObject(subjectId))
token.SubjectIds.Select(subjectId => ActiveDirectory.RetrieveObject(subjectId, Quick: true))
.Where(item => item != null)
.Select(item => Models.JobQueue.ShowModel.SubjectDescriptor.FromActiveDirectoryObject(item))
.OrderBy(item => item.Name).ToList();