- Timestamp:
- 02/08/18 11:13:15 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HiveProjectManagement/HeuristicLab.Services.Hive/3.3/Manager/AuthorizationManager.cs
r15715 r15737 92 92 93 93 // authorize if user is admin, project owner or owner of a parent project 94 public void AuthorizeForProjectAdministration(Guid projectId ) {94 public void AuthorizeForProjectAdministration(Guid projectId, bool parentalOwnership) { 95 95 if (projectId == null) return; 96 96 var currentUserId = UserManager.CurrentUserId; … … 98 98 var projectDao = pm.ProjectDao; 99 99 pm.UseTransaction(() => { 100 var projectBranch = projectDao.GetCurrentAndParentProjectsById(projectId).ToList(); 101 if(!projectBranch.Select(x => x.OwnerUserId).Contains(currentUserId) 102 && !RoleVerifier.IsInRole(HiveRoles.Administrator)) { 100 List<Project> projectBranch = null; 101 if(parentalOwnership) projectDao.GetParentProjectsById(projectId).ToList(); 102 else projectBranch = projectDao.GetCurrentAndParentProjectsById(projectId).ToList(); 103 104 if(!RoleVerifier.IsInRole(HiveRoles.Administrator) 105 && !projectBranch.Select(x => x.OwnerUserId).Contains(currentUserId)) { 103 106 throw new SecurityException(NOT_AUTHORIZED_USERPROJECT); 104 107 }
Note: See TracChangeset
for help on using the changeset viewer.