Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
12/11/17 16:56:19 (7 years ago)
Author:
jzenisek
Message:

#2839 finalized permission checks in AddTask and revised implementation of ResourcePermission methods

File:
1 edited

Legend:

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

    r15380 r15508  
    2727using DA = HeuristicLab.Services.Hive.DataAccess;
    2828using DT = HeuristicLab.Services.Hive.DataTransfer;
    29 
     29using System.Collections.Generic;
     30using System.Linq;
    3031
    3132namespace HeuristicLab.Services.Hive {
     
    8788        var project = projectDao.GetById(projectId);
    8889        if (project == null) throw new SecurityException(NOT_AUTHORIZED);
    89         if (project.OwnerUserId != UserManager.CurrentUserId
     90
     91        var projectTree = new List<Project>() { project };
     92        projectTree.AddRange(projectDao.GetProjectsByChildId(projectId));
     93        if(!projectTree.Select(x => x.OwnerUserId).Contains(UserManager.CurrentUserId)
    9094            && !RoleVerifier.IsInRole(HiveRoles.Administrator)) {
    9195          throw new SecurityException(NOT_AUTHORIZED);
Note: See TracChangeset for help on using the changeset viewer.