Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
06/25/09 12:41:40 (15 years ago)
Author:
mbecirov
Message:

#586: Fixed access on projects that causes a null-reference.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Hive.Server.Core/3.2/Authorization/HivePermissionManager.cs

    r2091 r2093  
    5151      p = policyCollection[policyName].GetPermissionByContext("Project");
    5252      //check if user has 'xxx.Project' permission
    53       if (p != null)
    54         //TODO: Test auf NULL von Project! 
    55         if (CheckPermission(sessionID, p.Id, jobManager.GetJobById(entityID).Obj.Project.Id)) return;
    56 
     53      if ((p != null) && (entityID!=Guid.Empty))
     54      {
     55          ResponseObject<Job> job = jobManager.GetJobById(entityID);
     56          if (job.Obj.Project != null)
     57              if (CheckPermission(sessionID, p.Id, jobManager.GetJobById(entityID).Obj.Project.Id)) return;
     58      }
    5759      //check if this policy has a permission with 'OWNER' scope defined
    5860      p = policyCollection[policyName].GetPermissionByContext("User");
     
    6062      if (p != null)
    6163        if (CheckPermission(sessionID, p.Id, jobManager.GetJobById(entityID).Obj.UserId)) return;
     64
    6265      //throw an exception when user access fails
    6366      //throw new PermissionException(policyName);
Note: See TracChangeset for help on using the changeset viewer.