Free cookie consent management tool by TermsFeed Policy Generator

Changeset 15577


Ignore:
Timestamp:
01/05/18 15:13:25 (6 years ago)
Author:
jzenisek
Message:

#2839 worked on service side mgmt of project-resource assignments and project-user permissions

Location:
branches/HiveProjectManagement
Files:
14 edited

Legend:

Unmodified
Added
Removed
  • branches/HiveProjectManagement/HeuristicLab.Services.Access.DataAccess/3.3/AccessService.dbml

    r14748 r15577  
    11<?xml version="1.0" encoding="utf-8"?><Database Name="HeuristicLab.ClientManagement" Class="AccessServiceDataContext" xmlns="http://schemas.microsoft.com/linqtosql/dbml/2007">
    2   <Connection Mode="AppSettings" ConnectionString="Data Source=.\SQLEXPRESS;Integrated Security=SSPI;Initial Catalog=HeuristicLab.AccessService" SettingsObjectName="HeuristicLab.Services.Access.DataAccess.Properties.Settings" SettingsPropertyName="HeuristicLab_ClientManagementConnectionString" Provider="System.Data.SqlClient" />
     2  <Connection Mode="AppSettings" ConnectionString="Data Source=HIVELAB;Integrated Security=SSPI;Initial Catalog=HeuristicLab.AccessService" SettingsObjectName="HeuristicLab.Services.Access.DataAccess.Properties.Settings" SettingsPropertyName="HeuristicLab_ClientManagementConnectionString" Provider="System.Data.SqlClient" />
    33  <Table Name="dbo.Resource" Member="Resources">
    44    <Type Name="Resource" InheritanceCode="Resource" IsInheritanceDefault="true">
  • branches/HiveProjectManagement/HeuristicLab.Services.Access/3.3/Interfaces/IUserManager.cs

    r15500 r15577  
    3333    IEnumerable<Guid> GetUserGroupIdsOfUser(Guid userId);
    3434    bool VerifyUser(Guid userId, List<Guid> allowedUserGroups);
     35    IEnumerable<DataTransfer.UserGroupMapping> GetUserGroupMapping();
    3536  }
    3637}
  • branches/HiveProjectManagement/HeuristicLab.Services.Access/3.3/UserManager.cs

    r15500 r15577  
    9090    }
    9191
     92    public IEnumerable<DataTransfer.UserGroupMapping> GetUserGroupMapping() {
     93      using (DA.AccessServiceDataContext context = new DA.AccessServiceDataContext()) {
     94        var query = from u in context.UserGroupUserGroups
     95                    select Convert.ToDto(u);
     96        return query.ToList();
     97      }
     98    }
     99
    92100    private bool CheckInGroupHierarchy(Guid userId, Guid group, Dictionary<Guid, Guid> ugMapping, List<DA.UserGroup> groups) {
    93101      //check all subgroups
  • branches/HiveProjectManagement/HeuristicLab.Services.Hive.DataAccess/3.3/Daos/AssignedJobResourceDao.cs

    r15552 r15577  
    3030    }
    3131
     32    public void DeleteByProjectIds(IEnumerable<Guid> projectIds) {
     33      string paramProjectIds = string.Join(",", projectIds.Select(x => string.Format("'{0}'", x)));
     34      if (!string.IsNullOrWhiteSpace(paramProjectIds)) {
     35        string queryString = string.Format(DeleteByProjectIdsQueryString, paramProjectIds);
     36        DataContext.ExecuteCommand(queryString);
     37      }
     38    }
     39
    3240    public void DeleteByProjectIdsAndUserIds(IEnumerable<Guid> projectIds, IEnumerable<Guid> userIds) {
    3341      string paramProjectIds = string.Join(",", projectIds.Select(x => string.Format("'{0}'", x)));
    34       string paramUserIds = string.Join(",", userIds.Select(x => string.Format("'{0}'", x)));
     42      string paramUserIds = string.Join(",", userIds.ToList().Select(x => string.Format("'{0}'", x)));
    3543      if (!string.IsNullOrWhiteSpace(paramProjectIds) && !string.IsNullOrWhiteSpace(paramUserIds)) {
    3644        string queryString = string.Format(DeleteByProjectIdsAndUserIdsQueryString, paramProjectIds, paramUserIds);
     
    8391    #region String queries
    8492    private const string DeleteByProjectIdQueryString = @"
    85       DELETE FROM [AssignedJobResource] ajr
    86       WHERE ajr.JobId IN
    87         (
    88           SELECT j.JobId
    89           FROM [Job] j
    90           WHERE j.ProjectId = {0}
     93      DELETE FROM [AssignedJobResource]
     94      WHERE JobId IN
     95        (
     96          SELECT j.JobId
     97          FROM [Job] j
     98          WHERE j.ProjectId = '{0}'
    9199        )
    92100    ";
    93101    private const string DeleteByProjectIdAndUserIdsQueryString = @"
    94       DELETE FROM [AssignedJobResource] ajr
    95       WHERE ajr.JobId IN
    96         (
    97           SELECT j.JobId
    98           FROM [Job] j
    99           WHERE j.ProjectId = {0}
     102      DELETE FROM [AssignedJobResource]
     103      WHERE JobId IN
     104        (
     105          SELECT j.JobId
     106          FROM [Job] j
     107          WHERE j.ProjectId = '{0}'
    100108          AND j.OwnerUserId IN ({1})
    101109        )
    102110    ";
     111    private const string DeleteByProjectIdsQueryString = @"
     112      DELETE FROM [AssignedJobResource]
     113      WHERE JobId IN
     114        (
     115          SELECT j.JobId
     116          FROM [Job] j
     117          WHERE j.ProjectId IN ({0})
     118        )
     119    ";
    103120    private const string DeleteByProjectIdsAndUserIdsQueryString = @"
    104       DELETE FROM [AssignedJobResource] ajr
    105       WHERE ajr.JobId IN
     121      DELETE FROM [AssignedJobResource]
     122      WHERE JobId IN
    106123        (
    107124          SELECT j.JobId
     
    112129    ";
    113130    private const string DeleteByProjectIdAndResourceIdsQueryString = @"
    114       DELETE FROM [AssignedJobResource] ajr
    115       WHERE ajr.JobId IN
    116         (
    117           SELECT j.JobId
    118           FROM [Job] j
    119           WHERE j.ProjectId = {0}
    120         )
    121       AND ajr.ResourceId IN ({1})
     131      DELETE FROM [AssignedJobResource]
     132      WHERE JobId IN
     133        (
     134          SELECT j.JobId
     135          FROM [Job] j
     136          WHERE j.ProjectId = '{0}'
     137        )
     138      AND ResourceId IN ({1})
    122139    ";
    123140    private const string DeleteByProjectIdsAndResourceIdsQueryString = @"
    124       DELETE FROM [AssignedJobResource] ajr
    125       WHERE ajr.JobId IN
     141      DELETE FROM [AssignedJobResource]
     142      WHERE JobId IN
    126143        (
    127144          SELECT j.JobId
     
    129146          WHERE j.ProjectId IN ({0})
    130147        )
    131       AND ajr.ResourceId IN ({1})
     148      AND ResourceId IN ({1})
    132149    ";
    133150    private const string CheckJobGrantedForResourceQueryString = @"
  • branches/HiveProjectManagement/HeuristicLab.Services.Hive.DataAccess/3.3/Daos/AssignedProjectResourceDao.cs

    r15546 r15577  
    3838
    3939    public void DeleteByProjectIdAndResourceIds(Guid projectId, IEnumerable<Guid> resourceIds) {
    40       string paramIds = string.Join(",", resourceIds.Select(x => string.Format("'{0}'", x)));
     40      string paramIds = string.Join(",", resourceIds.ToList().Select(x => string.Format("'{0}'", x)));
    4141      if (!string.IsNullOrWhiteSpace(paramIds)) {
    4242        string query = string.Format(DeleteByProjectIdAndResourceIdsQueryString, projectId, paramIds);
     
    4646
    4747    public void DeleteByProjectIdsAndResourceIds(IEnumerable<Guid> projectIds, IEnumerable<Guid> resourceIds) {
    48       string paramProjectIds = string.Join(",", projectIds.Select(x => string.Format("'{0}'", x)));
    49       string paramResourceIds = string.Join(",", resourceIds.Select(x => string.Format("'{0}'", x)));
    50       if (!string.IsNullOrWhiteSpace(paramResourceIds)) {
     48      string paramProjectIds = string.Join(",", projectIds.ToList().Select(x => string.Format("'{0}'", x)));
     49      string paramResourceIds = string.Join(",", resourceIds.ToList().Select(x => string.Format("'{0}'", x)));
     50      if (!string.IsNullOrWhiteSpace(paramProjectIds) && !string.IsNullOrWhiteSpace(paramResourceIds)) {
    5151        string query = string.Format(DeleteByProjectIdsAndResourceIdsQueryString, paramProjectIds, paramResourceIds);
    5252        DataContext.ExecuteCommand(query);
     
    5454    }
    5555
     56    public void DeleteByProjectIds(IEnumerable<Guid> projectIds) {
     57      string paramProjectIds = string.Join(",", projectIds.ToList().Select(x => string.Format("'{0}'", x)));
     58      if (!string.IsNullOrWhiteSpace(paramProjectIds)) {
     59        string query = string.Format(DeleteByProjectIdsQueryString, paramProjectIds);
     60        DataContext.ExecuteCommand(query);
     61      }
     62    }
     63
    5664    public bool CheckProjectGrantedForResources(Guid projectId, IEnumerable<Guid> resourceIds) {
    57       string paramResourceIds = string.Join(",", resourceIds.Select(x => string.Format("'{0}'", x)));
     65      string paramResourceIds = string.Join(",", resourceIds.ToList().Select(x => string.Format("'{0}'", x)));
    5866      if (!string.IsNullOrWhiteSpace(paramResourceIds)) {
    5967        string queryString = string.Format(CheckProjectGrantedForResourcesQueryString, projectId, paramResourceIds);
     
    8593
    8694    #region String queries
    87     private const string DeleteByProjectIdAndResourceIdsQueryString =
    88       @"DELETE FROM [AssignedProjectResource]
    89          WHERE ProjectId = '{0}'
    90            AND ResourceId IN ({1});";
    91     private const string DeleteByProjectIdsAndResourceIdsQueryString =
    92       @"DELETE FROM [AssignedProjectResource]
    93              WHERE ProjectId IN ({0})
    94                AND ResourceId IN ({1});";
     95    private const string DeleteByProjectIdAndResourceIdsQueryString = @"
     96      DELETE FROM [AssignedProjectResource]
     97        WHERE ProjectId = '{0}'
     98        AND ResourceId IN ({1});
     99    ";
     100    private const string DeleteByProjectIdsAndResourceIdsQueryString = @"
     101      DELETE FROM [AssignedProjectResource]
     102        WHERE ProjectId IN ({0})
     103        AND ResourceId IN ({1});
     104    ";
     105    private const string DeleteByProjectIdsQueryString = @"
     106      DELETE FROM [AssignedProjectResource]
     107        WHERE ProjectId IN ({0})
     108    ";
    95109    private const string CheckProjectGrantedForResourcesQueryString = @"
    96110    WITH rtree AS
  • branches/HiveProjectManagement/HeuristicLab.Services.Hive.DataAccess/3.3/Daos/ProjectDao.cs

    r15552 r15577  
    3333    }
    3434
    35     public IEnumerable<Project> GetGrantedProjectsForUser(IEnumerable<Guid> userAndGroupIds) {
    36       return GetGrantedProjectsForUserQuery(DataContext, userAndGroupIds);
     35    public IEnumerable<Project> GetUsageGrantedProjectsForUser(IEnumerable<Guid> userAndGroupIds) {
     36      string paramUserAndGroupIds = string.Join(",", userAndGroupIds.ToList().Select(x => string.Format("'{0}'", x)));
     37      if (!string.IsNullOrWhiteSpace(paramUserAndGroupIds)) {
     38        string queryString = string.Format(GetUsageGrantedProjectsForUserQueryString, paramUserAndGroupIds);
     39        return DataContext.ExecuteQuery<Project>(queryString);
     40      }
     41      return Enumerable.Empty<Project>();
     42    }
     43
     44    public IEnumerable<Project> GetAdministrationGrantedProjectsForUser(Guid userId) {
     45      return DataContext.ExecuteQuery<Project>(GetAdministrationGrantedProjectsForUserQueryString, userId);
    3746    }
    3847
     
    6776         where project.ProjectId == projectId
    6877         select project).SingleOrDefault());
    69     private static readonly Func<DataContext, IEnumerable<Guid>, IEnumerable<Project>> GetGrantedProjectsForUserQuery =
    70       CompiledQuery.Compile((DataContext db, IEnumerable<Guid> userAndGroupIds) =>
    71       (from project in db.GetTable<Project>()
    72        join projectPermission in db.GetTable<ProjectPermission>()
    73        on project.ProjectId equals projectPermission.ProjectId
    74        where userAndGroupIds.Contains(projectPermission.GrantedUserId)
    75        select project).Distinct());
    7678    #endregion
    7779
    78       #region String queries
     80    #region String queries
     81    private const string GetUsageGrantedProjectsForUserQueryString = @"
     82      SELECT DISTINCT p.*
     83      FROM [Project] p, [ProjectPermission] pp
     84      WHERE p.ProjectId = pp.ProjectId
     85      AND pp.GrantedUserId IN ({0})
     86    ";
     87
     88    private const string GetAdministrationGrantedProjectsForUserQueryString = @"
     89      WITH ptree AS
     90      (
     91        SELECT ProjectId, ParentProjectId
     92        FROM [Project]
     93        UNION ALL
     94        SELECT pt.ProjectId, p.ParentProjectId
     95        FROM [Project] p
     96        JOIN ptree pt ON pt.ParentProjectId = p.ProjectId AND p.ParentProjectId <> p.ProjectId AND pt.ParentProjectId <> pt.ProjectId
     97      )
     98      SELECT DISTINCT parent.*
     99      FROM [Project] parent
     100      WHERE parent.OwnerUserId = {0}
     101      UNION
     102      SELECT DISTINCT child.*
     103      FROM ptree, [Project] parent, [Project] child
     104      WHERE ptree.ParentProjectId = parent.ProjectId
     105      AND ptree.ProjectId = child.ProjectId
     106      AND parent.OwnerUserId = {0}
     107    ";
     108
    79109    private const string GetChildProjectsByIdQuery = @"
    80110      WITH ptree AS
  • branches/HiveProjectManagement/HeuristicLab.Services.Hive.DataAccess/3.3/Daos/ProjectPermissionDao.cs

    r15552 r15577  
    3838
    3939    public bool CheckUserGrantedForProject(Guid projectId, IEnumerable<Guid> userAndGroupIds) {
    40       string paramUserAndGroupIds = string.Join(",", userAndGroupIds.Select(x => string.Format("'{0}'", x)));
     40      string paramUserAndGroupIds = string.Join(",", userAndGroupIds.ToList().Select(x => string.Format("'{0}'", x)));
    4141      if(!string.IsNullOrWhiteSpace(paramUserAndGroupIds)) {
    4242        string queryString = string.Format(CheckUserGrantedForProjectQueryString, projectId, paramUserAndGroupIds);
     
    4747
    4848    public void DeleteByProjectIdAndGrantedUserIds(Guid projectId, IEnumerable<Guid> grantedUserIds) {
    49       string paramIds = string.Join(",", grantedUserIds.Select(x => string.Format("'{0}'", x)));
     49      string paramIds = string.Join(",", grantedUserIds.ToList().Select(x => string.Format("'{0}'", x)));
    5050      if (!string.IsNullOrWhiteSpace(paramIds)) {
    5151        string query = string.Format(DeleteByProjectIdAndGrantedUserIdsQueryString, projectId, paramIds);
     
    5555
    5656    public void DeleteByProjectIdsAndGrantedUserIds(IEnumerable<Guid> projectIds, IEnumerable<Guid> grantedUserIds) {
    57       string paramProjectIds = string.Join(",", projectIds.Select(x => string.Format("'{0}'", x)));
    58       string paramUserIds = string.Join(",", grantedUserIds.Select(x => string.Format("'{0}'", x)));
     57      string paramProjectIds = string.Join(",", projectIds.ToList().Select(x => string.Format("'{0}'", x)));
     58      string paramUserIds = string.Join(",", grantedUserIds.ToList().Select(x => string.Format("'{0}'", x)));
    5959      if (!string.IsNullOrWhiteSpace(paramProjectIds) && !string.IsNullOrWhiteSpace(paramUserIds)) {
    6060        string query = string.Format(DeleteByProjectIdsAndGrantedUserIdsQueryString, paramProjectIds, paramUserIds);
     
    7979    private const string DeleteByProjectIdsAndGrantedUserIdsQueryString = @"
    8080      DELETE FROM [ProjectPermission]
    81       WHERE ProjectId IN '({0})'
     81      WHERE ProjectId IN ({0})
    8282      AND GrantedUserId IN ({1});
    8383    ";
  • branches/HiveProjectManagement/HeuristicLab.Services.Hive.DataAccess/3.3/Daos/ResourceDao.cs

    r15540 r15577  
    3838
    3939    public bool CheckExistence(IEnumerable<Guid> ids) {
    40       string paramResourceIds = string.Join(",", ids.Select(x => string.Format("'{0}'", x)));
     40      string paramResourceIds = string.Join(",", ids.ToList().Select(x => string.Format("'{0}'", x)));
    4141      if (!string.IsNullOrWhiteSpace(paramResourceIds)) {
    4242        string queryString = string.Format(CountExistenceQuery, paramResourceIds);
    43         return DataContext.ExecuteQuery<int>(queryString).Count() == ids.Count();
     43        return DataContext.ExecuteQuery<int>(queryString).SingleOrDefault() == ids.Count();
    4444      }
    4545      return false;
  • branches/HiveProjectManagement/HeuristicLab.Services.Hive.DataAccess/3.3/HeuristicLab.Services.Hive.DataAccess-3.3.csproj

    r15540 r15577  
    151151    <Compile Include="Properties\AssemblyInfo.cs" />
    152152    <None Include="Properties\AssemblyInfo.cs.frame" />
     153    <Compile Include="Settings.cs" />
    153154    <Compile Include="Settings.Designer.cs">
    154155      <AutoGen>True</AutoGen>
  • branches/HiveProjectManagement/HeuristicLab.Services.Hive.DataAccess/3.3/HiveDataContext.dbml.layout

    r15528 r15577  
    8181      </nestedChildShapes>
    8282    </classShape>
    83     <associationConnector edgePoints="[(10.875 : 6.66429768880208); (11.25 : 6.66429768880208)]" fixedFrom="Algorithm" fixedTo="Algorithm">
     83    <associationConnector edgePoints="[(10.875 : 6.66429768880208); (11.25 : 6.66429768880208)]" fixedFrom="NotFixed" fixedTo="NotFixed">
    8484      <AssociationMoniker Name="/HiveDataContext/Plugin/Plugin_PluginData" />
    8585      <nodes>
     
    8888      </nodes>
    8989    </associationConnector>
    90     <associationConnector edgePoints="[(8.875 : 6.56814697265625); (8.5 : 6.56814697265625)]" fixedFrom="Algorithm" fixedTo="Algorithm">
     90    <associationConnector edgePoints="[(8.875 : 6.56814697265625); (8.5 : 6.56814697265625)]" fixedFrom="NotFixed" fixedTo="NotFixed">
    9191      <AssociationMoniker Name="/HiveDataContext/Plugin/Plugin_RequiredPlugin" />
    9292      <nodes>
     
    134134      </nodes>
    135135    </associationConnector>
    136     <associationConnector edgePoints="[(7.5 : 4.1170068359375); (7.5 : 5.875)]" fixedFrom="Algorithm" fixedTo="Algorithm">
     136    <associationConnector edgePoints="[(7.5 : 4.1170068359375); (7.5 : 5.875)]" fixedFrom="NotFixed" fixedTo="NotFixed">
    137137      <AssociationMoniker Name="/HiveDataContext/Task/Task_RequiredPlugin" />
    138138      <nodes>
     
    279279      </nodes>
    280280    </associationConnector>
    281     <associationConnector edgePoints="[(11.25 : 9.42390055338542); (10.375 : 9.42390055338542); (10.375 : 8); (4 : 8); (4 : 4.9631982421875); (5.125 : 4.9631982421875); (5.125 : 4.5881982421875)]" fixedFrom="NotFixed" fixedTo="Algorithm">
     281    <associationConnector edgePoints="[(11.25 : 9.42390055338542); (10.375 : 9.42390055338542); (10.375 : 8); (4 : 8); (4 : 4.9631982421875); (5.125 : 4.9631982421875); (5.125 : 4.5881982421875)]" fixedFrom="NotFixed" fixedTo="NotFixed">
    282282      <AssociationMoniker Name="/HiveDataContext/Project/Project_Job" />
    283283      <nodes>
     
    292292      </nestedChildShapes>
    293293    </classShape>
    294     <associationConnector edgePoints="[(8.031252 : 4.1170068359375); (8.031252 : 4.4375); (11.15625 : 4.4375); (11.15625 : 5.09699625651042); (11.25 : 5.09699625651042)]" fixedFrom="Algorithm" fixedTo="Algorithm">
     294    <associationConnector edgePoints="[(8.031252 : 4.1170068359375); (8.031252 : 4.4375); (11.15625 : 4.4375); (11.15625 : 5.09699625651042); (11.25 : 5.09699625651042)]" fixedFrom="NotFixed" fixedTo="NotFixed">
    295295      <AssociationMoniker Name="/HiveDataContext/Task/Task_AssignedTaskResource" />
    296296      <nodes>
     
    299299      </nodes>
    300300    </associationConnector>
    301     <associationConnector edgePoints="[(12.25 : 2.9631982421875); (12.25 : 4.5)]" fixedFrom="Algorithm" fixedTo="Algorithm">
     301    <associationConnector edgePoints="[(12.25 : 2.9631982421875); (12.25 : 4.5)]" fixedFrom="NotFixed" fixedTo="NotFixed">
    302302      <AssociationMoniker Name="/HiveDataContext/Resource/Resource_AssignedTaskResource" />
    303303      <nodes>
     
    333333      </nodes>
    334334    </associationConnector>
    335     <associationConnector edgePoints="[(5.656252 : 4.5881982421875); (5.656252 : 5.07535062109375); (7.41666666666667 : 5.07535062109375 : JumpStart); (7.58333333333333 : 5.07535062109375 : JumpEnd); (8.875 : 5.07535062109375)]" fixedFrom="NotFixed" fixedTo="NotFixed">
     335    <associationConnector edgePoints="[(5.656252 : 4.5881982421875); (5.656252 : 5.07535062109375); (8.875 : 5.07535062109375)]" fixedFrom="NotFixed" fixedTo="NotFixed">
    336336      <AssociationMoniker Name="/HiveDataContext/Job/Job_AssignedJobResource" />
    337337      <nodes>
  • branches/HiveProjectManagement/HeuristicLab.Services.Hive.DataAccess/3.3/HiveDataContext.designer.cs

    r15528 r15577  
    390390    }
    391391   
    392     [global::System.Data.Linq.Mapping.AssociationAttribute(Name="Resource_AssignedProjectResource", Storage="_Resource", ThisKey="ResourceId", OtherKey="ResourceId", IsForeignKey=true, DeleteRule="CASCADE")]
     392    [global::System.Data.Linq.Mapping.AssociationAttribute(Name="Resource_AssignedProjectResource", Storage="_Resource", ThisKey="ResourceId", OtherKey="ResourceId", IsForeignKey=true, DeleteOnNull=true)]
    393393    public Resource Resource
    394394    {
     
    424424    }
    425425   
    426     [global::System.Data.Linq.Mapping.AssociationAttribute(Name="Project_AssignedProjectResource", Storage="_Project", ThisKey="ProjectId", OtherKey="ProjectId", IsForeignKey=true, DeleteRule="CASCADE")]
     426    [global::System.Data.Linq.Mapping.AssociationAttribute(Name="Project_AssignedProjectResource", Storage="_Project", ThisKey="ProjectId", OtherKey="ProjectId", IsForeignKey=true, DeleteOnNull=true)]
    427427    public Project Project
    428428    {
     
    58095809    }
    58105810   
    5811     [global::System.Data.Linq.Mapping.AssociationAttribute(Name="Project_AssignedProjectResource", Storage="_AssignedResources", ThisKey="ProjectId", OtherKey="ProjectId")]
     5811    [global::System.Data.Linq.Mapping.AssociationAttribute(Name="Project_AssignedProjectResource", Storage="_AssignedResources", ThisKey="ProjectId", OtherKey="ProjectId", DeleteRule="CASCADE")]
    58125812    public EntitySet<AssignedProjectResource> AssignedProjectResources
    58135813    {
     
    58485848    }
    58495849   
    5850     [global::System.Data.Linq.Mapping.AssociationAttribute(Name="Project_ProjectPermission", Storage="_ProjectPermissions", ThisKey="ProjectId", OtherKey="ProjectId")]
     5850    [global::System.Data.Linq.Mapping.AssociationAttribute(Name="Project_ProjectPermission", Storage="_ProjectPermissions", ThisKey="ProjectId", OtherKey="ProjectId", DeleteRule="CASCADE")]
    58515851    public EntitySet<ProjectPermission> ProjectPermissions
    58525852    {
     
    60606060    }
    60616061   
    6062     [global::System.Data.Linq.Mapping.AssociationAttribute(Name="Project_ProjectPermission", Storage="_Project", ThisKey="ProjectId", OtherKey="ProjectId", IsForeignKey=true)]
     6062    [global::System.Data.Linq.Mapping.AssociationAttribute(Name="Project_ProjectPermission", Storage="_Project", ThisKey="ProjectId", OtherKey="ProjectId", IsForeignKey=true, DeleteOnNull=true)]
    60636063    public Project Project
    60646064    {
  • branches/HiveProjectManagement/HeuristicLab.Services.Hive/3.3/HiveService.cs

    r15552 r15577  
    764764        var projectPermissionDao = pm.ProjectPermissionDao;
    765765        var currentUserId = UserManager.CurrentUserId;
    766         return pm.UseTransaction(() => {
    767           var userAndGroupIds = new List<Guid> { currentUserId };
    768           userAndGroupIds.AddRange(UserManager.GetUserGroupIdsOfUser(currentUserId));
    769           return projectDao.GetGrantedProjectsForUser(userAndGroupIds)
    770             .Select(x => x.ToDto());
     766        var userAndGroupIds = new List<Guid> { currentUserId };
     767        userAndGroupIds.AddRange(UserManager.GetUserGroupIdsOfUser(currentUserId));
     768        return pm.UseTransaction(() => {
     769          return projectDao.GetUsageGrantedProjectsForUser(userAndGroupIds)
     770            .Select(x => x.ToDto()).ToList();
     771        });
     772      }
     773    }
     774
     775    public IEnumerable<DT.Project> GetProjectsForAdministration() {
     776      RoleVerifier.AuthenticateForAnyRole(HiveRoles.Administrator, HiveRoles.Client);
     777      bool isAdministrator = RoleVerifier.IsInRole(HiveRoles.Administrator);
     778      var pm = PersistenceManager;
     779      using (new PerformanceLogger("GetProjectsForAdministration")) {
     780        var projectDao = pm.ProjectDao;
     781        //var projectPermissionDao = pm.ProjectPermissionDao;
     782       
     783        return pm.UseTransaction(() => {
     784          if(isAdministrator) {
     785            return projectDao.GetAll().Select(x => x.ToDto()).ToList();
     786          } else {
     787            var currentUserId = UserManager.CurrentUserId;
     788            return projectDao.GetAdministrationGrantedProjectsForUser(currentUserId)
     789              .Select(x => x.ToDto()).ToList();
     790
     791          }
     792
    771793          //var projectPermissions = projectPermissionDao.GetAll();
    772794          //return projectDao.GetAll().ToList()
     
    786808
    787809    #region ProjectPermission Methods
    788     public void GrantProjectPermissions(Guid projectId, Guid[] grantedUserIds, bool cascading) {
    789       RoleVerifier.AuthenticateForAnyRole(HiveRoles.Administrator, HiveRoles.Client);
     810    public void SaveProjectPermissions(Guid projectId, List<Guid> grantedUserIds, bool reassign, bool cascading, bool reassignCascading) {
     811      RoleVerifier.AuthenticateForAnyRole(HiveRoles.Administrator, HiveRoles.Client);
     812      if (projectId == null || grantedUserIds == null) return;
    790813      AuthorizationManager.AuthorizeForProjectAdministration(projectId);
    791814      var pm = PersistenceManager;
    792815      using (new PerformanceLogger("GrantProjectPermissions")) {
    793816        var projectDao = pm.ProjectDao;
     817        var projectPermissionDao = pm.ProjectPermissionDao;
     818        var assignedJobResourceDao = pm.AssignedJobResourceDao;
    794819
    795820        pm.UseTransaction(() => {
    796821          var project = projectDao.GetById(projectId);
    797           var projectPermissions = project.ProjectPermissions.ToList();
     822          var projectPermissions = project.ProjectPermissions.Select(x => x.GrantedUserId);
     823          var addedPermissions = grantedUserIds.Except(projectPermissions);
     824          var removedPermissions = projectPermissions.Except(grantedUserIds);
     825
     826          // remove job assignments and project permissions
     827          if (reassign) {
     828            assignedJobResourceDao.DeleteByProjectId(project.ProjectId);
     829            project.ProjectPermissions.Clear();
     830          } else {
     831            assignedJobResourceDao.DeleteByProjectIdAndUserIds(project.ProjectId, removedPermissions);
     832            foreach(var item in project.ProjectPermissions.ToList().Where(x => removedPermissions.Contains(x.GrantedUserId))) {
     833              project.ProjectPermissions.Remove(item);
     834            }
     835          }
     836          pm.SubmitChanges();
     837
     838          // add project permissions
    798839          foreach (var id in grantedUserIds) {
    799             if (projectPermissions.All(x => x.GrantedUserId != id)) {
     840            if(project.ProjectPermissions.All(x => x.GrantedUserId != id)) {
    800841              project.ProjectPermissions.Add(new DA.ProjectPermission {
    801842                GrantedUserId = id,
     
    804845            }
    805846          }
     847          pm.SubmitChanges();
     848
    806849          if (cascading) {
    807             var childProjects = projectDao.GetChildProjectsById(projectId);
    808             foreach (var p in childProjects) {
    809               p.ProjectPermissions.Clear();
     850            var childProjects = projectDao.GetChildProjectsById(projectId).ToList();
     851            var childProjectIds = childProjects.Select(x => x.ProjectId).ToList();
     852
     853            // remove job assignments
     854            if (reassignCascading) {
     855              assignedJobResourceDao.DeleteByProjectIds(childProjectIds);
     856            } else {
     857              assignedJobResourceDao.DeleteByProjectIdsAndUserIds(childProjectIds, removedPermissions);
     858            }
     859
     860            foreach(var p in childProjects) {
     861              // remove project permissions
     862              if(reassignCascading) {
     863                p.AssignedProjectResources.Clear();
     864              } else {
     865                foreach(var item in p.ProjectPermissions.ToList().Where(x => removedPermissions.Contains(x.GrantedUserId))) {
     866                  p.ProjectPermissions.Remove(item);
     867                }
     868              }
     869              pm.SubmitChanges();
     870
     871              // add project permissions
    810872              foreach (var id in grantedUserIds) {
    811                 p.ProjectPermissions.Add(new DA.ProjectPermission {
    812                   GrantedUserId = id,
    813                   GrantedByUserId = UserManager.CurrentUserId
    814                 });
     873                if (p.ProjectPermissions.All(x => x.GrantedUserId != id)) {
     874                  p.ProjectPermissions.Add(new DA.ProjectPermission {
     875                    GrantedUserId = id,
     876                    GrantedByUserId = UserManager.CurrentUserId
     877                  });
     878                }
    815879              }
    816880            }
     
    821885    }
    822886
    823     public void RevokeProjectPermissions(Guid projectId, Guid[] grantedUserIds, bool cascading) {
    824       RoleVerifier.AuthenticateForAnyRole(HiveRoles.Administrator, HiveRoles.Client);
     887    public void GrantProjectPermissions(Guid projectId, List<Guid> grantedUserIds, bool cascading) {
     888      throw new NotImplementedException();
     889    }
     890
     891    public void RevokeProjectPermissions(Guid projectId, List<Guid> grantedUserIds, bool cascading) {
     892      RoleVerifier.AuthenticateForAnyRole(HiveRoles.Administrator, HiveRoles.Client);
     893      if (projectId == null || grantedUserIds == null || !grantedUserIds.Any()) return;
    825894      AuthorizationManager.AuthorizeForProjectAdministration(projectId);
    826895      var pm = PersistenceManager;
     
    831900        pm.UseTransaction(() => {
    832901          if (cascading) {
    833             var childProjectIds = projectDao.GetChildProjectIdsById(projectId);
     902            var childProjectIds = projectDao.GetChildProjectIdsById(projectId).ToList();
    834903            projectPermissionDao.DeleteByProjectIdsAndGrantedUserIds(childProjectIds, grantedUserIds);
    835904            assignedJobResourceDao.DeleteByProjectIdsAndUserIds(childProjectIds, grantedUserIds);
     
    857926
    858927    #region AssignedProjectResource Methods
    859     public void AssignProjectResources(Guid projectId, Guid[] resourceIds, bool cascading) {
    860       RoleVerifier.AuthenticateForAnyRole(HiveRoles.Administrator, HiveRoles.Client);
     928    // basic: remove and add assignments (resourceIds) to projectId and its depending jobs
     929    // reassign: clear all assignments from project and its depending jobs, before adding new ones (resourceIds)
     930    // cascading: "basic" mode for child-projects
     931    // reassignCascading: "reassign" mode for child-projects
     932    public void SaveProjectResourceAssignments(Guid projectId, List<Guid> resourceIds, bool reassign, bool cascading, bool reassignCascading) {
     933      RoleVerifier.AuthenticateForAnyRole(HiveRoles.Administrator, HiveRoles.Client);
     934      if (projectId == null || resourceIds == null) return;
    861935      AuthorizationManager.AuthorizeForProjectResourceAdministration(projectId, resourceIds);
    862936      var pm = PersistenceManager;
    863937      using (new PerformanceLogger("AssignProjectResources")) {
    864938        var projectDao = pm.ProjectDao;
     939        var assignedProjectResourceDao = pm.AssignedProjectResourceDao;
     940        var assignedJobResourceDao = pm.AssignedJobResourceDao;
    865941        pm.UseTransaction(() => {
    866942          var project = projectDao.GetById(projectId);
    867           var assignedProjectResources = project.AssignedProjectResources.ToList();
    868 
     943          var assignedResources = project.AssignedProjectResources.Select(x => x.ResourceId);
     944          var addedAssignments = resourceIds.Except(assignedResources);
     945          var removedAssignments = assignedResources.Except(resourceIds);
     946
     947          // remove job and project assignments
     948          if (reassign) {
     949            assignedJobResourceDao.DeleteByProjectId(project.ProjectId);
     950            //assignedProjectResourceDao.DeleteByProjectIds(new List<Guid> { projectId });
     951            project.AssignedProjectResources.Clear();
     952          } else {
     953            assignedJobResourceDao.DeleteByProjectIdAndResourceIds(projectId, removedAssignments);
     954            //assignedProjectResourceDao.DeleteByProjectIdAndResourceIds(projectId, removedAssignments);
     955            foreach (var item in project.AssignedProjectResources.ToList().Where(x => removedAssignments.Contains(x.ResourceId))) {
     956              project.AssignedProjectResources.Remove(item);
     957            }
     958          }
     959          pm.SubmitChanges();
     960
     961          // add project assignments
    869962          foreach (var id in resourceIds) {
    870             if (assignedProjectResources.All(x => x.ResourceId != id)) {
     963            if (project.AssignedProjectResources.All(x => x.ResourceId != id)) {
    871964              project.AssignedProjectResources.Add(new DA.AssignedProjectResource {
    872965                ResourceId = id
     
    874967            }
    875968          }
     969          pm.SubmitChanges();
     970
    876971          if (cascading) {
    877             var childProjects = projectDao.GetChildProjectsById(projectId);
     972            var childProjects = projectDao.GetChildProjectsById(projectId).ToList();
     973
     974            // remove job assignments
     975            if (reassignCascading) {
     976              assignedJobResourceDao.DeleteByProjectIds(childProjects.Select(x => x.ProjectId).ToList());
     977            } else {
     978              var childProjectIds = childProjects.Select(x => x.ProjectId).ToList();
     979              assignedJobResourceDao.DeleteByProjectIdsAndResourceIds(childProjectIds, removedAssignments);
     980            }
    878981            foreach (var p in childProjects) {
    879               p.AssignedProjectResources.Clear();
     982              // remove project assignments
     983              if (reassignCascading) {
     984                //assignedProjectResourceDao.DeleteByProjectIds(new List<Guid> { p.ProjectId });
     985                p.AssignedProjectResources.Clear();
     986              } else {
     987                //assignedProjectResourceDao.DeleteByProjectIdAndResourceIds(p.ProjectId, removedAssignments);
     988                foreach (var item in p.AssignedProjectResources.ToList().Where(x => removedAssignments.Contains(x.ResourceId))) {
     989                  p.AssignedProjectResources.Remove(item);
     990                }
     991              }
     992              pm.SubmitChanges();
     993
     994              // add project assignments
    880995              foreach (var id in resourceIds) {
    881                 p.AssignedProjectResources.Add(new DA.AssignedProjectResource {
    882                   ResourceId = id
    883                 });
     996                if(p.AssignedProjectResources.All(x => x.ResourceId != id)) {
     997                  p.AssignedProjectResources.Add(new DA.AssignedProjectResource {
     998                    ResourceId = id
     999                  });
     1000                }
    8841001              }
    8851002            }
     
    8901007    }
    8911008
    892     public void UnassignProjectResources(Guid projectId, Guid[] resourceIds, bool cascading) {
    893       RoleVerifier.AuthenticateForAnyRole(HiveRoles.Administrator, HiveRoles.Client);
     1009    public void AssignProjectResources(Guid projectId, List<Guid> resourceIds, bool cascading) {
     1010      throw new NotImplementedException();
     1011    }
     1012
     1013    // basic: unassign resourceIds from project and depending jobs
     1014    // cascading: unassign resourceIds from all child-projects and their depending jobs
     1015    public void UnassignProjectResources(Guid projectId, List<Guid> resourceIds, bool cascading) {
     1016      RoleVerifier.AuthenticateForAnyRole(HiveRoles.Administrator, HiveRoles.Client);
     1017      if (projectId == null || resourceIds == null || !resourceIds.Any()) return;
    8941018      AuthorizationManager.AuthorizeForProjectResourceAdministration(projectId, resourceIds);
    8951019      var pm = PersistenceManager;
     
    9001024        pm.UseTransaction(() => {
    9011025          if (cascading) {
    902             var childProjectIds = projectDao.GetChildProjectIdsById(projectId);
     1026            var childProjectIds = projectDao.GetChildProjectIdsById(projectId).ToList();
    9031027            assignedProjectResourceDao.DeleteByProjectIdsAndResourceIds(childProjectIds, resourceIds);
    9041028            assignedJobResourceDao.DeleteByProjectIdsAndResourceIds(childProjectIds, resourceIds);
     
    9701094      using (new PerformanceLogger("GetSlaves")) {
    9711095        var slaveDao = pm.SlaveDao;
    972         var resourcePermissionDao = pm.ProjectPermissionDao;
     1096        //var projectPermissionDao = pm.ProjectPermissionDao;
    9731097        var currentUserId = UserManager.CurrentUserId;
    9741098        return pm.UseTransaction(() => {
    975           var resourcePermissions = resourcePermissionDao.GetAll();
    976           return slaveDao.GetAll().ToList()
    977             .Where(x => isAdministrator
    978               || x.OwnerUserId == null
    979               || x.OwnerUserId == currentUserId
    980               || UserManager.VerifyUser(currentUserId, resourcePermissions
    981                   //.Where(y => y.ResourceId == x.ResourceId)
    982                   .Select(z => z.GrantedUserId)
    983                   .ToList())
    984               )
    985             .Select(x => x.ToDto())
    986             .ToList();
     1099            return slaveDao.GetAll().ToList()
     1100              .Where( x => isAdministrator
     1101              || x.OwnerUserId == null
     1102              || x.OwnerUserId == currentUserId)
     1103              .Select(x => x.ToDto())
     1104              .ToList();
     1105          //var projectPermissions = projectPermissionDao.GetAll();
     1106          //return slaveDao.GetAll().ToList()
     1107          //  .Where(x => isAdministrator
     1108          //    || x.OwnerUserId == null
     1109          //    || x.OwnerUserId == currentUserId
     1110          //    || UserManager.VerifyUser(currentUserId, projectPermissions
     1111          //        //.Where(y => y.ResourceId == x.ResourceId)
     1112          //        .Select(z => z.GrantedUserId)
     1113          //        .ToList())
     1114          //    )
     1115          //  .Select(x => x.ToDto())
     1116          //  .ToList();
    9871117        });
    9881118      }
     
    9951125      using (new PerformanceLogger("GetSlaveGroups")) {
    9961126        var slaveGroupDao = pm.SlaveGroupDao;
    997         var resourcePermissionDao = pm.ProjectPermissionDao;
     1127        var projectPermissionDao = pm.ProjectPermissionDao;
    9981128        var currentUserId = UserManager.CurrentUserId;
    9991129        return pm.UseTransaction(() => {
    1000           var resourcePermissions = resourcePermissionDao.GetAll();
     1130          //var projectPermissions = projectPermissionDao.GetAll();
    10011131          return slaveGroupDao.GetAll().ToList()
    10021132            .Where(x => isAdministrator
    10031133              || x.OwnerUserId == null
    10041134              || x.OwnerUserId == currentUserId
    1005               || UserManager.VerifyUser(currentUserId, resourcePermissions
    1006                   //.Where(y => y.ResourceId == x.ResourceId)
    1007                   .Select(z => z.GrantedUserId)
    1008                   .ToList())
    1009               )
     1135              //|| UserManager.VerifyUser(currentUserId, projectPermissions
     1136              //    //.Where(y => y.ResourceId == x.ResourceId)
     1137              //    .Select(z => z.GrantedUserId)
     1138              //    .ToList())
     1139             )
    10101140            .Select(x => x.ToDto())
    10111141            .ToList();
     
    12201350      var user = ServiceLocator.Instance.UserManager.GetUserByName(username);
    12211351      return user != null ? (Guid?)user.ProviderUserKey ?? Guid.Empty : Guid.Empty;
     1352    }
     1353   
     1354    public Dictionary<Guid, HashSet<Guid>> GetUserGroupTree() {
     1355      var userGroupTree = new Dictionary<Guid, HashSet<Guid>>();
     1356      var userGroupMapping = UserManager.GetUserGroupMapping();
     1357
     1358      foreach(var ugm in userGroupMapping) {
     1359        if (ugm.Parent == null || ugm.Child == null) continue;
     1360
     1361        if (!userGroupTree.ContainsKey(ugm.Parent)) {
     1362          userGroupTree.Add(ugm.Parent, new HashSet<Guid>());
     1363        }
     1364        userGroupTree[ugm.Parent].Add(ugm.Child);
     1365      }
     1366
     1367      return userGroupTree;
    12221368    }
    12231369    #endregion
  • branches/HiveProjectManagement/HeuristicLab.Services.Hive/3.3/Manager/AuthorizationManager.cs

    r15552 r15577  
    7575    // authorize if user is admin or resource owner
    7676    public void AuthorizeForResourceAdministration(Guid resourceId) {
     77      var currentUserId = UserManager.CurrentUserId;
    7778      var pm = PersistenceManager;
    7879      var resourceDao = pm.ResourceDao;
     
    8182        if (resource == null) throw new SecurityException(NOT_AUTHORIZED_USERRESOURCE);
    8283
    83         if (resource.OwnerUserId != UserManager.CurrentUserId
     84        if (resource.OwnerUserId != currentUserId
    8485            && !RoleVerifier.IsInRole(HiveRoles.Administrator)) {
    8586          throw new SecurityException(NOT_AUTHORIZED_USERRESOURCE);
     
    9091    // authorize if user is admin, project owner or owner of a parent project
    9192    public void AuthorizeForProjectAdministration(Guid projectId) {
     93      if (projectId == null) return;
     94      var currentUserId = UserManager.CurrentUserId;
    9295      var pm = PersistenceManager;
    9396      var projectDao = pm.ProjectDao;
     
    98101
    99102        var projectBranch = projectDao.GetCurrentAndParentProjectsById(projectId);
    100         if(!projectBranch.Select(x => x.OwnerUserId).Contains(UserManager.CurrentUserId)
     103        if(!projectBranch.Select(x => x.OwnerUserId).Contains(currentUserId)
    101104            && !RoleVerifier.IsInRole(HiveRoles.Administrator)) {
    102105          throw new SecurityException(NOT_AUTHORIZED_USERPROJECT);
     
    107110    // authorize if user is admin, or owner of a parent project, for which the resources are assigned to
    108111    public void AuthorizeForProjectResourceAdministration(Guid projectId, IEnumerable<Guid> resourceIds) {
     112      if (projectId == null) return;
     113      var currentUserId = UserManager.CurrentUserId;
    109114      var pm = PersistenceManager;
    110115      var projectDao = pm.ProjectDao;
     
    117122
    118123        // check if resourceIds exist
    119         if (!resourceDao.CheckExistence(resourceIds))
     124        if (resourceIds != null && resourceIds.Any() && !resourceDao.CheckExistence(resourceIds))
    120125          throw new SecurityException(NOT_AUTHORIZED_USERRESOURCE);
    121126
     
    123128        if (RoleVerifier.IsInRole(HiveRoles.Administrator)) return;
    124129
    125         // check if user is owner of a parent project and...
     130        // check if user is owner of a parent project
     131        var projectBranch = projectDao.GetParentProjectsById(projectId);
     132        if (!projectBranch.Select(x => x.OwnerUserId).Contains(currentUserId)
     133            && !RoleVerifier.IsInRole(HiveRoles.Administrator)) {
     134          throw new SecurityException(NOT_AUTHORIZED_USERPROJECT);
     135        }
     136
    126137        // check if the all argument resourceIds are among the assigned resources of the owned projects
    127         var grantedResourceIds = assignedProjectResourceDao.GetAllGrantedResourceIdsOfOwnedParentProjects(projectId, UserManager.CurrentUserId);
     138        var grantedResourceIds = assignedProjectResourceDao.GetAllGrantedResourceIdsOfOwnedParentProjects(projectId, currentUserId);
    128139        if(resourceIds.Except(grantedResourceIds).Any()) {
    129140          throw new SecurityException(NOT_AUTHORIZED_USERRESOURCE);
     
    134145    // Check if a project is authorized to use a list of resources
    135146    public void AuthorizeProjectForResourcesUse(Guid projectId, IEnumerable<Guid> resourceIds) {
     147      if (projectId == null || resourceIds == null || !resourceIds.Any()) return;
    136148      var pm = PersistenceManager;
    137149      var assignedProjectResourceDao = pm.AssignedProjectResourceDao;
     
    143155    // note: administrators and project owner are NOT automatically granted
    144156    public void AuthorizeUserForProjectUse(Guid userId, Guid projectId) {
     157      if (userId == null || projectId == null) return;
    145158      var pm = PersistenceManager;
    146159      // collect current and group membership Ids
     
    166179
    167180    private void AuthorizeJob(IPersistenceManager pm, Guid jobId, DT.Permission requiredPermission) {
     181      var currentUserId = UserManager.CurrentUserId;
    168182      var requiredPermissionEntity = requiredPermission.ToEntity();
    169       DA.Permission permission = GetPermissionForJob(pm, jobId, UserManager.CurrentUserId);
     183      DA.Permission permission = GetPermissionForJob(pm, jobId, currentUserId);
    170184      if (permission == Permission.NotAllowed
    171185          || ((permission != requiredPermissionEntity) && requiredPermissionEntity == Permission.Full)) {
  • branches/HiveProjectManagement/HeuristicLab.Services.Hive/3.3/ServiceContracts/IHiveService.cs

    r15546 r15577  
    147147    [OperationContract]
    148148    IEnumerable<Project> GetProjects();
     149
     150    [OperationContract]
     151    IEnumerable<Project> GetProjectsForAdministration();
    149152    #endregion
    150153
    151154    #region ProjectPermission Methods
    152155    [OperationContract]
    153     void GrantProjectPermissions(Guid projectId, Guid[] grantedUserIds, bool cascading);
    154 
    155     [OperationContract]
    156     void RevokeProjectPermissions(Guid projectId, Guid[] grantedUserIds, bool cascading);
     156    void SaveProjectPermissions(Guid projectId, List<Guid> grantedUserIds, bool reassign, bool cascading, bool reassignCascading);
     157
     158    [OperationContract]
     159    void GrantProjectPermissions(Guid projectId, List<Guid> grantedUserIds, bool cascading);
     160
     161    [OperationContract]
     162    void RevokeProjectPermissions(Guid projectId, List<Guid> grantedUserIds, bool cascading);
    157163
    158164    [OperationContract]
     
    162168    #region AssignedProjectResource Methods
    163169    [OperationContract]
    164     void AssignProjectResources(Guid projectId, Guid[] resourceIds, bool cascading);
    165 
    166     [OperationContract]
    167     void UnassignProjectResources(Guid projectId, Guid[] resourceIds, bool cascading);
     170    void SaveProjectResourceAssignments(Guid projectId, List<Guid> resourceIds, bool reassign, bool cascading, bool reassignCascading);
     171
     172    [OperationContract]
     173    void AssignProjectResources(Guid projectId, List<Guid> resourceIds, bool cascading);
     174
     175    [OperationContract]
     176    void UnassignProjectResources(Guid projectId, List<Guid> resourceIds, bool cascading);
    168177
    169178    [OperationContract]
     
    235244    [OperationContract]
    236245    Guid GetUserIdByUsername(string username);
     246
     247    [OperationContract]
     248    Dictionary<Guid, HashSet<Guid>> GetUserGroupTree();
    237249    #endregion
    238250
Note: See TracChangeset for help on using the changeset viewer.