Changeset 15628 for branches/HiveProjectManagement/HeuristicLab.Services.Hive/3.3/Manager/AuthorizationManager.cs
- Timestamp:
- 01/17/18 15:24:44 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HiveProjectManagement/HeuristicLab.Services.Hive/3.3/Manager/AuthorizationManager.cs
r15577 r15628 96 96 var projectDao = pm.ProjectDao; 97 97 pm.UseTransaction(() => { 98 // check if project exists (not necessary) 99 var project = projectDao.GetById(projectId); 100 if (project == null) throw new SecurityException(NOT_AUTHORIZED_USERPROJECT); 101 102 var projectBranch = projectDao.GetCurrentAndParentProjectsById(projectId); 98 var projectBranch = projectDao.GetCurrentAndParentProjectsById(projectId).ToList(); 103 99 if(!projectBranch.Select(x => x.OwnerUserId).Contains(currentUserId) 104 100 && !RoleVerifier.IsInRole(HiveRoles.Administrator)) { … … 129 125 130 126 // check if user is owner of a parent project 131 var projectBranch = projectDao.GetParentProjectsById(projectId) ;127 var projectBranch = projectDao.GetParentProjectsById(projectId).ToList(); 132 128 if (!projectBranch.Select(x => x.OwnerUserId).Contains(currentUserId) 133 129 && !RoleVerifier.IsInRole(HiveRoles.Administrator)) { … … 136 132 137 133 // check if the all argument resourceIds are among the assigned resources of the owned projects 138 var grantedResourceIds = assignedProjectResourceDao.GetAllGrantedResourceIdsOfOwnedParentProjects(projectId, currentUserId) ;134 var grantedResourceIds = assignedProjectResourceDao.GetAllGrantedResourceIdsOfOwnedParentProjects(projectId, currentUserId).ToList(); 139 135 if(resourceIds.Except(grantedResourceIds).Any()) { 140 136 throw new SecurityException(NOT_AUTHORIZED_USERRESOURCE);
Note: See TracChangeset
for help on using the changeset viewer.