Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
01/26/18 08:51:30 (6 years ago)
Author:
jzenisek
Message:

#2839

  • worked on (restricted) accessibility of hive's administration area for non-admin roles
  • adapted HiveClient & HiveAdminClient entity loading (client- & service-side)
Location:
branches/HiveProjectManagement/HeuristicLab.Services.Hive.DataAccess/3.3
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/HiveProjectManagement/HeuristicLab.Services.Hive.DataAccess/3.3/Daos/AssignedProjectResourceDao.cs

    r15628 r15658  
    7777    public IEnumerable<Guid> GetAllGrantedResourceIdsByProjectId(Guid projectId) {
    7878      return DataContext.ExecuteQuery<Guid>(GetAllGrantedResourceIdsByProjectIdQueryString, projectId);
     79    }
     80
     81    public IEnumerable<Resource> GetAllGrantedResourcesByProjectIds(IEnumerable<Guid> projectIds) {
     82      string paramProjectIds = string.Join(",", projectIds.ToList().Select(x => string.Format("'{0}'", x)));
     83      if (!string.IsNullOrWhiteSpace(paramProjectIds)) {
     84        string queryString = string.Format(GetAllGrantedResourcesByProjectIdsQueryString, paramProjectIds);
     85        return DataContext.ExecuteQuery<Resource>(queryString);
     86      }
     87      return Enumerable.Empty<Resource>();
    7988    }
    8089
     
    173182    WHERE apr.ProjectId = '{0}'
    174183    ";
     184    private const string GetAllGrantedResourcesByProjectIdsQueryString = @"
     185      WITH rtree AS
     186      (
     187        SELECT ResourceId, ParentResourceId
     188        FROM [Resource]
     189        UNION ALL
     190        SELECT rt.ResourceId, r.ParentResourceId
     191        FROM [Resource] r
     192        JOIN rtree rt ON rt.ParentResourceId = r.ResourceId
     193      )
     194      SELECT res.*
     195      FROM rtree, [AssignedProjectResource] apr, [Resource] res
     196      WHERE rtree.ParentResourceId = apr.ResourceId
     197      AND rtree.ResourceId = res.ResourceId
     198      AND apr.ProjectId IN ({0})
     199      UNION
     200      SELECT res.*
     201      FROM [AssignedProjectResource] apr, [Resource] res
     202      WHERE apr.ResourceId = res.ResourceId
     203      AND apr.ProjectId IN ({0})
     204    ";
    175205    private const string GetAllGrantedResourceIdsOfOwnedParentProjectsQueryString = @"
    176206      WITH pbranch AS
  • branches/HiveProjectManagement/HeuristicLab.Services.Hive.DataAccess/3.3/HeuristicLab.Services.Hive.DataAccess-3.3.csproj

    r15644 r15658  
    110110    <Compile Include="Daos\HiveStatistics\DimClientDao.cs" />
    111111    <Compile Include="Daos\HiveStatistics\DimJobDao.cs" />
     112    <Compile Include="Daos\HiveStatistics\DimProjectDao.cs" />
    112113    <Compile Include="Daos\HiveStatistics\DimTimeDao.cs" />
    113114    <Compile Include="Daos\HiveStatistics\DimUserDao.cs" />
    114115    <Compile Include="Daos\HiveStatistics\FactClientInfoDao.cs" />
     116    <Compile Include="Daos\HiveStatistics\FactProjectInfoDao.cs" />
    115117    <Compile Include="Daos\HiveStatistics\FactTaskDao.cs" />
    116118    <Compile Include="Daos\JobDao.cs" />
Note: See TracChangeset for help on using the changeset viewer.