Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
01/17/18 15:24:44 (6 years ago)
Author:
jzenisek
Message:

#2839

  • updated TaskDao towards independency of the formerly used Task-Resource assignment entity
  • updated several permission/assignment handling service methods for client
  • added AssignedJobResource DTO
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HiveProjectManagement/HeuristicLab.Services.Hive/3.3/Manager/AuthorizationManager.cs

    r15577 r15628  
    9696      var projectDao = pm.ProjectDao;
    9797      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();
    10399        if(!projectBranch.Select(x => x.OwnerUserId).Contains(currentUserId)
    104100            && !RoleVerifier.IsInRole(HiveRoles.Administrator)) {
     
    129125
    130126        // check if user is owner of a parent project
    131         var projectBranch = projectDao.GetParentProjectsById(projectId);
     127        var projectBranch = projectDao.GetParentProjectsById(projectId).ToList();
    132128        if (!projectBranch.Select(x => x.OwnerUserId).Contains(currentUserId)
    133129            && !RoleVerifier.IsInRole(HiveRoles.Administrator)) {
     
    136132
    137133        // 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();
    139135        if(resourceIds.Except(grantedResourceIds).Any()) {
    140136          throw new SecurityException(NOT_AUTHORIZED_USERRESOURCE);
Note: See TracChangeset for help on using the changeset viewer.