Changeset 16203
- Timestamp:
- 10/01/18 15:18:23 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/HeuristicLab.Services.Hive/3.3/HiveService.cs
r16187 r16203 355 355 return pm.UseTransaction(() => { 356 356 // check if user is granted to administer the requested projectId 357 var administrationGrantedProjects = projectDao 358 .GetAdministrationGrantedProjectsForUser(currentUserId) 359 .ToList(); 357 bool isAdmin = RoleVerifier.IsInRole(HiveRoles.Administrator); 358 List<DA.Project> administrationGrantedProjects; 359 if (isAdmin) { 360 administrationGrantedProjects = projectDao.GetAll().ToList(); 361 } else { 362 administrationGrantedProjects = projectDao 363 .GetAdministrationGrantedProjectsForUser(currentUserId) 364 .ToList(); 365 } 360 366 361 367 if (administrationGrantedProjects.Select(x => x.ProjectId).Contains(projectId)) { … … 382 388 return pm.UseTransaction(() => { 383 389 // check for which of requested projectIds the user is granted to administer 384 var administrationGrantedProjectIds = projectDao 385 .GetAdministrationGrantedProjectsForUser(currentUserId) 386 .Select(x => x.ProjectId) 387 .ToList(); 390 bool isAdmin = RoleVerifier.IsInRole(HiveRoles.Administrator); 391 List<Guid> administrationGrantedProjectIds; 392 if (isAdmin) { 393 administrationGrantedProjectIds = projectDao.GetAll().Select(x => x.ProjectId).ToList(); 394 } else { 395 administrationGrantedProjectIds = projectDao 396 .GetAdministrationGrantedProjectsForUser(currentUserId) 397 .Select(x => x.ProjectId) 398 .ToList(); 399 } 388 400 var requestedAndGrantedProjectIds = projectIds.Intersect(administrationGrantedProjectIds); 389 401
Note: See TracChangeset
for help on using the changeset viewer.