Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
02/08/18 11:13:15 (6 years ago)
Author:
jzenisek
Message:

#2839

  • updated sql scripts (necessary foreign key option alterations & introduction of statistic tables)
  • updated HiveService according to changed client side (deletion-routine, permission checking,...)
File:
1 edited

Legend:

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

    r15715 r15737  
    9292
    9393    // 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) {
    9595      if (projectId == null) return;
    9696      var currentUserId = UserManager.CurrentUserId;
     
    9898      var projectDao = pm.ProjectDao;
    9999      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)) {
    103106          throw new SecurityException(NOT_AUTHORIZED_USERPROJECT);
    104107        }
Note: See TracChangeset for help on using the changeset viewer.