Changeset 15576


Ignore:
Timestamp:
01/05/18 15:10:38 (11 months ago)
Author:
jzenisek
Message:

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

Location:
branches/HiveProjectManagement
Files:
15 edited

Legend:

Unmodified
Added
Removed
  • branches/HiveProjectManagement/HeuristicLab.Clients.Access.Administration/3.3/Views/UserGroupView.Designer.cs

    r14185 r15576  
    8585      this.idTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
    8686                  | System.Windows.Forms.AnchorStyles.Right)));
    87       this.idTextBox.Enabled = false;
     87      this.idTextBox.ReadOnly = true;
    8888      this.idTextBox.Location = new System.Drawing.Point(79, 29);
    8989      this.idTextBox.Name = "idTextBox";
  • branches/HiveProjectManagement/HeuristicLab.Clients.Access.Administration/3.3/Views/UserGroupView.cs

    r15567 r15576  
    7171      base.SetEnabledStateOfControls();
    7272      bool enabled = Content != null && !Locked;
    73       groupNameTextBox.ReadOnly = enabled;
     73      groupNameTextBox.ReadOnly = !enabled;
     74      idTextBox.ReadOnly = !enabled;
     75      storeButton.Enabled = enabled;
     76      refreshableLightweightUserView.Enabled = enabled;
     77      //refreshableLightweightUserView.Locked = !enabled;
     78      //refreshableLightweightUserView.ReadOnly = !enabled;
    7479    }
    7580
  • branches/HiveProjectManagement/HeuristicLab.Clients.Access.Administration/3.3/Views/UserView.cs

    r15567 r15576  
    6666      bool enabled = Content != null && !Locked;
    6767     
    68       userNameTextBox.ReadOnly = enabled;
    69       fullNameTextBox.ReadOnly = enabled;
    70       emailTextBox.ReadOnly = enabled;
     68      userNameTextBox.ReadOnly = !enabled;
     69      fullNameTextBox.ReadOnly = !enabled;
     70      emailTextBox.ReadOnly = !enabled;
    7171
    7272      if (Content == null) {
  • branches/HiveProjectManagement/HeuristicLab.Clients.Access.Views/3.3/UserViews/LightweightUserInformationView.cs

    r14185 r15576  
    6565    }
    6666
     67    protected override void SetEnabledStateOfControls() {
     68      base.SetEnabledStateOfControls();
     69      bool enabled = Content != null && !Locked;
     70      //userNameTextBox.ReadOnly = !enabled;
     71      fullNameTextBox.ReadOnly = !enabled;
     72      emailTextBox.ReadOnly = !enabled;
     73      //rolesListView.Enabled = enabled;
     74      //groupsListView.Enabled = enabled;
     75      changePasswordButton.Enabled = enabled;
     76    }
     77
    6778    private void changePasswordButton_Click(object sender, System.EventArgs e) {
    6879      using (ChangePasswordDialog dialog = new ChangePasswordDialog()) {
  • branches/HiveProjectManagement/HeuristicLab.Clients.Hive.Administrator/3.3/HeuristicLab.Clients.Hive.Administrator-3.3.csproj

    r15422 r15576  
    284284    </ProjectReference>
    285285  </ItemGroup>
     286  <ItemGroup>
     287    <EmbeddedResource Include="Views\ProjectView.resx">
     288      <DependentUpon>ProjectView.cs</DependentUpon>
     289    </EmbeddedResource>
     290  </ItemGroup>
    286291  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
    287292  <PropertyGroup>
  • branches/HiveProjectManagement/HeuristicLab.Clients.Hive.Administrator/3.3/Views/ProjectPermissionsView.Designer.cs

    r15422 r15576  
    108108      this.permissionsGroupBox.TabIndex = 0;
    109109      this.permissionsGroupBox.TabStop = false;
    110       this.permissionsGroupBox.Text = "Permissions (Assigned + Inherited)";
     110      this.permissionsGroupBox.Text = "Permissions (Assigned + Included)";
    111111      //
    112112      // treeView
  • branches/HiveProjectManagement/HeuristicLab.Clients.Hive.Administrator/3.3/Views/ProjectPermissionsView.cs

    r15567 r15576  
    3939    private readonly HashSet<UserGroupBase> assignedPermissions = new HashSet<UserGroupBase>();
    4040    private readonly HashSet<UserGroupBase> inheritedPermissions = new HashSet<UserGroupBase>();
     41    private readonly HashSet<UserGroupBase> newAssignedPermissions = new HashSet<UserGroupBase>();
     42    private readonly HashSet<UserGroupBase> newInheritedPermissions = new HashSet<UserGroupBase>();
     43    private readonly Dictionary<Guid, HashSet<UserGroupBase>> userGroupAncestors = new Dictionary<Guid, HashSet<UserGroupBase>>();
     44    private readonly Dictionary<Guid, HashSet<UserGroupBase>> userGroupDescendants = new Dictionary<Guid, HashSet<UserGroupBase>>();
     45
     46    private readonly Color addedAssignmentColor = Color.FromArgb(255, 87, 191, 193); // #57bfc1
     47    private readonly Color removedAssignmentColor = Color.FromArgb(255, 236, 159, 72); // #ec9f48
     48    private readonly Color addedIncludeColor = Color.FromArgb(25, 169, 221, 221); // #a9dddd
     49    private readonly Color removedIncludeColor = Color.FromArgb(25, 249, 210, 145); // #f9d291
    4150
    4251    public new Project Content {
     
    5867        assignedPermissions.Clear();
    5968        inheritedPermissions.Clear();
     69        newAssignedPermissions.Clear();
     70        newInheritedPermissions.Clear();
    6071        treeView.Nodes.Clear();
    6172        detailsViewHost.Content = null;
    6273      } else {
    63         UpdateAssignedPermissions();
    64         UpdateInheritedPermissions();
    65         var top = BuildPermissionsList(AccessClient.Instance.UsersAndGroups);
    66         detailsViewHost.Content = top;
     74        UpdatePermissionList();
    6775        detailsViewHost.ActiveView.Locked = true;
    68        
    6976      }
    7077    }
     
    7784
    7885    private void refreshButton_Click(object sender, EventArgs e) {
     86      UpdatePermissionList();
     87    }
     88
     89    private async void inheritButton_Click(object sender, EventArgs e) {
     90      await SecurityExceptionUtil.TryAsyncAndReportSecurityExceptions(
     91        action: () => SetGrantedProjectPermissions(Content.Id, newAssignedPermissions.Select(x => x.Id), false, true, true));
     92      UpdatePermissionList();
     93    }
     94
     95    private async void saveButton_Click(object sender, EventArgs e) {
     96      await SecurityExceptionUtil.TryAsyncAndReportSecurityExceptions(
     97        action: () => SetGrantedProjectPermissions(Content.Id, newAssignedPermissions.Select(x => x.Id), false, false, false));
     98      UpdatePermissionList();
     99    }
     100
     101    private void treeView_AfterSelect(object sender, TreeViewEventArgs e) {
     102      var selectedPermission = (UserGroupBase)e.Node.Tag;
     103      detailsViewHost.Content = selectedPermission;
     104    }
     105
     106    private void treeView_BeforeCheck(object sender, TreeViewCancelEventArgs e) {
     107      var checkedPermission = (UserGroupBase)e.Node.Tag;
     108      if (e.Node.Parent == null || newInheritedPermissions.Contains(checkedPermission) || checkedPermission.Id == Guid.Empty) e.Cancel = true;
     109    }
     110
     111    private void treeView_AfterCheck(object sender, TreeViewEventArgs e) {
     112      var checkedPermission = (UserGroupBase)e.Node.Tag;
     113      if (e.Node.Checked)
     114        newAssignedPermissions.Add(checkedPermission);
     115      else
     116        newAssignedPermissions.Remove(checkedPermission);
     117
     118      UpdateNewPermissionList();
     119    }
     120    #endregion
     121
     122    #region Helpers
     123    private void UpdatePermissionList() {
     124      UpdateUserGroupGenealogy();
    79125      UpdateAssignedPermissions();
    80126      UpdateInheritedPermissions();
     
    83129    }
    84130
    85     private void inheritButton_Click(object sender, EventArgs e) {
    86       SetGrantedProjectPermissions(Content.Id, Enumerable.Empty<Guid>());
    87       UpdateAssignedPermissions();
    88       UpdateInheritedPermissions();
     131    private void UpdateNewPermissionList() {
     132      UpdateNewAssignedPermissions();
     133      UpdateNewInheritedPermissions();
    89134      var top = BuildPermissionsList(AccessClient.Instance.UsersAndGroups);
    90135      detailsViewHost.Content = top;
    91136    }
    92137
    93     private async void saveButton_Click(object sender, EventArgs e) {
    94       await SecurityExceptionUtil.TryAsyncAndReportSecurityExceptions(
    95         action: () => SetGrantedProjectPermissions(Content.Id, assignedPermissions.Select(x => x.Id)));
    96     }
    97 
    98     private void treeView_AfterSelect(object sender, TreeViewEventArgs e) {
    99       var selectedPermission = (UserGroupBase)e.Node.Tag;
    100       detailsViewHost.Content = selectedPermission;
    101     }
    102 
    103     private void treeView_BeforeCheck(object sender, TreeViewCancelEventArgs e) {
    104       var checkedPermission = (UserGroupBase)e.Node.Tag;
    105       if (e.Node.Parent == null || inheritedPermissions.Contains(checkedPermission) || checkedPermission.Id == Guid.Empty) e.Cancel = true;
    106     }
    107 
    108     private void treeView_AfterCheck(object sender, TreeViewEventArgs e) {
    109       var checkedPermission = (UserGroupBase)e.Node.Tag;
    110       if (e.Node.Checked)
    111         assignedPermissions.Add(checkedPermission);
    112       else
    113         assignedPermissions.Remove(checkedPermission);
    114     }
    115     #endregion
    116 
    117     #region Helpers
     138    private void UpdateAssignedPermissions() {
     139      assignedPermissions.Clear();
     140      newAssignedPermissions.Clear();
     141      var grantedPermissions = GetGrantedPermissionsForProject(Content.Id);
     142      foreach (var r in grantedPermissions) {
     143        assignedPermissions.Add(r);
     144        newAssignedPermissions.Add(r);
     145      }
     146    }
     147
     148    private void UpdateNewAssignedPermissions() {
     149      for(int i = newAssignedPermissions.Count-1; i >= 0; i--) {
     150        if(newAssignedPermissions.Intersect(userGroupAncestors[newAssignedPermissions.ElementAt(i).Id]).Any()) {
     151          newAssignedPermissions.Remove(newAssignedPermissions.ElementAt(i));
     152        }
     153      }
     154    }
     155
     156    private void UpdateInheritedPermissions() {
     157      inheritedPermissions.Clear();
     158      newInheritedPermissions.Clear();
     159      foreach(var item in assignedPermissions) {
     160        if(userGroupDescendants.ContainsKey(item.Id)) {
     161          foreach(var descendant in userGroupDescendants[item.Id]) {
     162            inheritedPermissions.Add(descendant);
     163            newInheritedPermissions.Add(descendant);
     164          }
     165        }
     166      }
     167    }
     168
     169    private void UpdateNewInheritedPermissions() {
     170      newInheritedPermissions.Clear();
     171      foreach(var item in newAssignedPermissions) {
     172        if(userGroupDescendants.ContainsKey(item.Id)) {
     173          foreach(var descendant in userGroupDescendants[item.Id]) {
     174            newInheritedPermissions.Add(descendant);
     175          }
     176        }
     177      }
     178    }
     179
     180    private void UpdateUserGroupGenealogy() {
     181      userGroupAncestors.Clear();
     182      userGroupDescendants.Clear();
     183
     184      var usersAndGroups = AccessClient.Instance.UsersAndGroups;
     185      foreach (var ug in usersAndGroups) {
     186        userGroupAncestors.Add(ug.Id, new HashSet<UserGroupBase>());
     187        userGroupDescendants.Add(ug.Id, new HashSet<UserGroupBase>());
     188      }
     189
     190      var userGroupTree = HiveServiceLocator.Instance.CallHiveService(s => s.GetUserGroupTree());
     191      foreach(var branch in userGroupTree) {
     192        var parent = usersAndGroups.Where(x => x.Id == branch.Key).SingleOrDefault();
     193        if(parent != null) {
     194          var userGroupsToAdd = usersAndGroups.Where(x => userGroupTree[parent.Id].Contains(x.Id));
     195          foreach (var node in userGroupsToAdd) {
     196            userGroupDescendants[parent.Id].Add(node);
     197            userGroupAncestors[node.Id].Add(parent);
     198          }
     199        }
     200      }
     201    }
     202
    118203    private static IEnumerable<UserGroupBase> GetGrantedPermissionsForProject(Guid projectId) {
    119204      var projectPermissions = HiveServiceLocator.Instance.CallHiveService(s => s.GetProjectPermissions(projectId));
     
    122207    }
    123208
    124     private static void SetGrantedProjectPermissions(Guid projectId, IEnumerable<Guid> userIds) {
     209    private static void SetGrantedProjectPermissions(Guid projectId, IEnumerable<Guid> userIds, bool reassign, bool cascading, bool reassignCascading) {
     210      if (projectId == null || userIds == null) return;
    125211      HiveServiceLocator.Instance.CallHiveService(s => {
    126         var currentlyAssignedPermissions = s.GetProjectPermissions(projectId);
    127         s.RevokeProjectPermissions(projectId, currentlyAssignedPermissions.Select(x => x.GrantedUserId).ToList());
    128         s.GrantProjectPermissions(projectId, userIds.ToList());
     212        s.SaveProjectPermissions(projectId, userIds.ToList(), reassign, cascading, reassignCascading);
    129213      });
    130     }
    131 
    132     private void UpdateAssignedPermissions() {
    133       assignedPermissions.Clear();
    134       foreach (var r in GetGrantedPermissionsForProject(Content.Id))
    135         assignedPermissions.Add(r);
    136     }
    137 
    138     private void UpdateInheritedPermissions() {
    139       inheritedPermissions.Clear();
    140       var parentProject = HiveAdminClient.Instance.Projects.SingleOrDefault(x => x.Id == Content.ParentProjectId);
    141       while (parentProject != null) {
    142         foreach (var r in GetGrantedPermissionsForProject(parentProject.Id))
    143           inheritedPermissions.Add(r);
    144         parentProject = HiveAdminClient.Instance.Projects.SingleOrDefault(x => x.Id == parentProject.ParentProjectId);
    145       }
    146214    }
    147215
     
    164232        node.ImageIndex = userGroupImageIndex;
    165233        node.SelectedImageIndex = node.ImageIndex;
    166 
    167         if (inheritedPermissions.Contains(group)) {
    168           node.Checked = true;
    169           node.Text += " (Inherited)";
    170           node.ForeColor = SystemColors.GrayText;
    171         } else if (assignedPermissions.Contains(group))
    172           node.Checked = true;
    173 
     234        BuildNode(group, node);
    174235        groupsNode.Nodes.Add(node);
    175236        if (first == null) first = group;
     
    183244        node.ImageIndex = userImageIndex;
    184245        node.SelectedImageIndex = node.ImageIndex;
    185 
    186         if (inheritedPermissions.Contains(user)) {
    187           node.Checked = true;
    188           node.Text += " (Inherited)";
    189           node.ForeColor = SystemColors.GrayText;
    190         } else if (assignedPermissions.Contains(user))
    191           node.Checked = true;
    192 
     246        BuildNode(user, node);
    193247        usersNode.Nodes.Add(node);
    194248        if (first == null) first = user;
     
    203257      return first;
    204258    }
     259
     260    private void BuildNode(UserGroupBase ug, TreeNode node) {
     261      var addedPermissions = newAssignedPermissions.Except(assignedPermissions);
     262      var removedPermissions = assignedPermissions.Except(newAssignedPermissions);
     263      var addedIncludes = newInheritedPermissions.Except(inheritedPermissions);
     264      var removedIncludes = inheritedPermissions.Except(newInheritedPermissions);
     265
     266      if (newAssignedPermissions.Contains(ug)) {
     267        node.Checked = true;
     268      } else if (newInheritedPermissions.Contains(ug)) {
     269        node.Checked = true;
     270        node.ForeColor = SystemColors.GrayText;
     271      }
     272
     273      if (inheritedPermissions.Contains(ug) && newInheritedPermissions.Contains(ug)) {
     274        node.Text += " [included]";
     275      } else if (addedIncludes.Contains(ug)) {
     276        node.BackColor = addedIncludeColor;
     277        node.ForeColor = SystemColors.GrayText;
     278        node.Text += " [added include]";
     279      } else if (removedIncludes.Contains(ug)) {
     280        node.BackColor = removedIncludeColor;
     281        node.ForeColor = SystemColors.GrayText;
     282        node.Text += " [removed include]";
     283      }
     284
     285      if (addedPermissions.Contains(ug)) {
     286        node.BackColor = addedAssignmentColor;
     287        node.ForeColor = SystemColors.ControlText;
     288        node.Text += " [added assignment]";
     289      } else if (removedPermissions.Contains(ug)) {
     290        node.BackColor = removedAssignmentColor;
     291        node.ForeColor = SystemColors.ControlText;
     292        node.Text += " [removed assignment]";
     293      }
     294
     295    }
     296
    205297    #endregion
    206298  }
  • branches/HiveProjectManagement/HeuristicLab.Clients.Hive.Administrator/3.3/Views/ProjectResourcesView.Designer.cs

    r15422 r15576  
    102102      this.resourcesGroupBox.TabIndex = 0;
    103103      this.resourcesGroupBox.TabStop = false;
    104       this.resourcesGroupBox.Text = "Resources (Assigned + Inherited)";
     104      this.resourcesGroupBox.Text = "Resources (Assigned + Included)";
    105105      //
    106106      // treeView
  • branches/HiveProjectManagement/HeuristicLab.Clients.Hive.Administrator/3.3/Views/ProjectResourcesView.cs

    r15567 r15576  
    9797    }
    9898
    99     private void inheritButton_Click(object sender, EventArgs e) {
    100       return;
    101       SetAssignedProjectResources(Content.Id, Enumerable.Empty<Guid>());
    102       UpdateAssignedResources();
    103       UpdateResourceGenealogy();
    104       var top = BuildResourceTree(HiveAdminClient.Instance.Resources);
    105       detailsViewHost.Content = top;
     99    private async void inheritButton_Click(object sender, EventArgs e) {
     100      await SecurityExceptionUtil.TryAsyncAndReportSecurityExceptions(
     101        action: () => {
     102          SetAssignedProjectResources(Content.Id, newAssignedResources.Select(x => x.Id), false, true);
     103        });
     104      UpdateResourceTree();
    106105    }
    107106
     
    109108      await SecurityExceptionUtil.TryAsyncAndReportSecurityExceptions(
    110109        action: () => {
    111           SetAssignedProjectResources(Content.Id, newAssignedResources.Select(x => x.Id));
     110          SetAssignedProjectResources(Content.Id, newAssignedResources.Select(x => x.Id), false, false);
    112111        });
    113112      UpdateResourceTree();
     
    132131      }
    133132
    134       UpdateNewAssignedResources();
    135       UpdateNewInheritedResources();
    136       var top = BuildResourceTree(HiveAdminClient.Instance.Resources);
    137       detailsViewHost.Content = top;
     133      UpdateNewResourceTree();
    138134    }
    139135    #endregion
    140136
    141137    #region Helpers
    142 
    143     //private void DisableResourceTree(TreeNode node) {
    144     //  foreach(var n in node.Nodes) {
    145 
    146     //  }
    147     //}
    148138
    149139    private void UpdateResourceTree() {
     
    154144    }
    155145
     146    private void UpdateNewResourceTree() {
     147      UpdateNewAssignedResources();
     148      UpdateNewInheritedResources();
     149      var top = BuildResourceTree(HiveAdminClient.Instance.Resources);
     150      detailsViewHost.Content = top;
     151    }
     152
    156153    private static IEnumerable<Resource> GetAssignedResourcesForProject(Guid projectId) {
    157154      var assignedProjectResources = HiveServiceLocator.Instance.CallHiveService(s => s.GetAssignedResourcesForProject(projectId));
     
    159156    }
    160157
    161     private void SetAssignedProjectResources(Guid projectId, IEnumerable<Guid> resourceIds) {
     158    private void SetAssignedProjectResources(Guid projectId, IEnumerable<Guid> resourceIds, bool reassign, bool cascading) {
     159      if (projectId == null || resourceIds == null) return;
    162160      HiveServiceLocator.Instance.CallHiveService(s => {
    163         var currentlyAssignedResources = s.GetAssignedResourcesForProject(projectId);
    164         s.UnassignProjectResources(projectId, currentlyAssignedResources.Select(x => x.ResourceId).ToList());
    165         s.AssignProjectResources(projectId, resourceIds.ToList());
     161       s.SaveProjectResourceAssignments(projectId, resourceIds.ToList(), reassign, cascading, true);
    166162      });
    167163    }
     
    295291          newNode.BackColor = addedIncludeColor;
    296292          newNode.ForeColor = SystemColors.GrayText;
    297           newNode.Text += " [+included]";
     293          newNode.Text += " [added include]";
    298294        } else if (removedIncludes.Contains(newResource)) {
    299295          newNode.BackColor = removedIncludeColor;
    300           newNode.Text += " [-included]";
     296          newNode.Text += " [removed include]";
    301297        }
    302298
     
    304300          newNode.BackColor = addedAssignmentColor;
    305301          newNode.ForeColor = SystemColors.ControlText;
    306           newNode.Text += " [added]";
     302          newNode.Text += " [added assignment]";
    307303        } else if (removedAssignments.Contains(newResource)) {
    308304          newNode.BackColor = removedAssignmentColor;
    309305          newNode.ForeColor = SystemColors.ControlText;
    310           newNode.Text += " [removed]";
     306          newNode.Text += " [removed assignment]";
    311307        }
    312308
  • branches/HiveProjectManagement/HeuristicLab.Clients.Hive.Administrator/3.3/Views/ProjectView.Designer.cs

    r15422 r15576  
    2424    /// </summary>
    2525    private void InitializeComponent() {
     26      System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ProjectView));
     27      this.idLabel = new System.Windows.Forms.Label();
     28      this.idTextBox = new System.Windows.Forms.TextBox();
    2629      this.nameLabel = new System.Windows.Forms.Label();
    2730      this.nameTextBox = new System.Windows.Forms.TextBox();
     
    4043      this.SuspendLayout();
    4144      //
     45      // idLabel
     46      //
     47      this.idLabel.AutoSize = true;
     48      this.idLabel.Location = new System.Drawing.Point(3, 11);
     49      this.idLabel.Name = "idLabel";
     50      this.idLabel.Size = new System.Drawing.Size(19, 13);
     51      this.idLabel.TabIndex = 0;
     52      this.idLabel.Text = "Id:";
     53      //
     54      // idTextBox
     55      //
     56      this.idTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
     57            | System.Windows.Forms.AnchorStyles.Right)));
     58      this.idTextBox.Location = new System.Drawing.Point(72, 8);
     59      this.idTextBox.Name = "idTextBox";
     60      this.idTextBox.ReadOnly = true;
     61      this.idTextBox.Size = new System.Drawing.Size(464, 20);
     62      this.idTextBox.TabIndex = 1;
     63      //
    4264      // nameLabel
    4365      //
    4466      this.nameLabel.AutoSize = true;
    45       this.nameLabel.Location = new System.Drawing.Point(3, 11);
     67      this.nameLabel.Location = new System.Drawing.Point(3, 37);
    4668      this.nameLabel.Name = "nameLabel";
    4769      this.nameLabel.Size = new System.Drawing.Size(38, 13);
    48       this.nameLabel.TabIndex = 0;
     70      this.nameLabel.TabIndex = 2;
    4971      this.nameLabel.Text = "Name:";
    5072      //
     
    5375      this.nameTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
    5476            | System.Windows.Forms.AnchorStyles.Right)));
    55       this.nameTextBox.Location = new System.Drawing.Point(72, 8);
     77      this.nameTextBox.Location = new System.Drawing.Point(72, 34);
    5678      this.nameTextBox.Name = "nameTextBox";
    5779      this.nameTextBox.Size = new System.Drawing.Size(464, 20);
    58       this.nameTextBox.TabIndex = 1;
     80      this.nameTextBox.TabIndex = 3;
    5981      this.nameTextBox.TextChanged += new System.EventHandler(this.nameTextBox_TextChanged);
    6082      this.nameTextBox.Validating += new System.ComponentModel.CancelEventHandler(this.nameTextBox_Validating);
     
    6385      //
    6486      this.descriptionLabel.AutoSize = true;
    65       this.descriptionLabel.Location = new System.Drawing.Point(3, 37);
     87      this.descriptionLabel.Location = new System.Drawing.Point(3, 63);
    6688      this.descriptionLabel.Name = "descriptionLabel";
    6789      this.descriptionLabel.Size = new System.Drawing.Size(63, 13);
    68       this.descriptionLabel.TabIndex = 2;
     90      this.descriptionLabel.TabIndex = 4;
    6991      this.descriptionLabel.Text = "Description:";
    7092      //
     
    7395      this.descriptionTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
    7496            | System.Windows.Forms.AnchorStyles.Right)));
    75       this.descriptionTextBox.Location = new System.Drawing.Point(72, 34);
     97      this.descriptionTextBox.Location = new System.Drawing.Point(72, 60);
    7698      this.descriptionTextBox.Multiline = true;
    7799      this.descriptionTextBox.Name = "descriptionTextBox";
    78100      this.descriptionTextBox.Size = new System.Drawing.Size(464, 98);
    79       this.descriptionTextBox.TabIndex = 3;
     101      this.descriptionTextBox.TabIndex = 5;
    80102      this.descriptionTextBox.TextChanged += new System.EventHandler(this.descriptionTextBox_TextChanged);
    81103      //
     
    86108      this.ownerComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
    87109      this.ownerComboBox.FormattingEnabled = true;
    88       this.ownerComboBox.Location = new System.Drawing.Point(102, 138);
     110      this.ownerComboBox.Location = new System.Drawing.Point(102, 164);
    89111      this.ownerComboBox.Name = "ownerComboBox";
    90112      this.ownerComboBox.Size = new System.Drawing.Size(434, 21);
    91       this.ownerComboBox.TabIndex = 5;
     113      this.ownerComboBox.TabIndex = 6;
    92114      this.ownerComboBox.SelectedIndexChanged += new System.EventHandler(this.ownerComboBox_SelectedIndexChanged);
    93115      //
     
    95117      //
    96118      this.ownerLabel.AutoSize = true;
    97       this.ownerLabel.Location = new System.Drawing.Point(3, 141);
     119      this.ownerLabel.Location = new System.Drawing.Point(3, 167);
    98120      this.ownerLabel.Name = "ownerLabel";
    99121      this.ownerLabel.Size = new System.Drawing.Size(41, 13);
    100       this.ownerLabel.TabIndex = 4;
     122      this.ownerLabel.TabIndex = 7;
    101123      this.ownerLabel.Text = "Owner:";
    102124      //
     
    104126      //
    105127      this.createdLabel.AutoSize = true;
    106       this.createdLabel.Location = new System.Drawing.Point(3, 171);
     128      this.createdLabel.Location = new System.Drawing.Point(3, 197);
    107129      this.createdLabel.Name = "createdLabel";
    108130      this.createdLabel.Size = new System.Drawing.Size(47, 13);
    109       this.createdLabel.TabIndex = 6;
     131      this.createdLabel.TabIndex = 8;
    110132      this.createdLabel.Text = "Created:";
    111133      //
     
    115137      this.startDateTimePicker.Enabled = false;
    116138      this.startDateTimePicker.Format = System.Windows.Forms.DateTimePickerFormat.Custom;
    117       this.startDateTimePicker.Location = new System.Drawing.Point(72, 190);
     139      this.startDateTimePicker.Location = new System.Drawing.Point(72, 216);
    118140      this.startDateTimePicker.Name = "startDateTimePicker";
    119141      this.startDateTimePicker.Size = new System.Drawing.Size(200, 20);
     
    124146      //
    125147      this.startLabel.AutoSize = true;
    126       this.startLabel.Location = new System.Drawing.Point(3, 197);
     148      this.startLabel.Location = new System.Drawing.Point(3, 223);
    127149      this.startLabel.Name = "startLabel";
    128150      this.startLabel.Size = new System.Drawing.Size(32, 13);
    129       this.startLabel.TabIndex = 8;
     151      this.startLabel.TabIndex = 10;
    130152      this.startLabel.Text = "Start:";
    131153      //
     
    135157      this.endDateTimePicker.Enabled = false;
    136158      this.endDateTimePicker.Format = System.Windows.Forms.DateTimePickerFormat.Custom;
    137       this.endDateTimePicker.Location = new System.Drawing.Point(72, 217);
     159      this.endDateTimePicker.Location = new System.Drawing.Point(72, 243);
    138160      this.endDateTimePicker.Name = "endDateTimePicker";
    139161      this.endDateTimePicker.Size = new System.Drawing.Size(200, 20);
     
    144166      //
    145167      this.endLabel.AutoSize = true;
    146       this.endLabel.Location = new System.Drawing.Point(3, 223);
     168      this.endLabel.Location = new System.Drawing.Point(3, 249);
    147169      this.endLabel.Name = "endLabel";
    148170      this.endLabel.Size = new System.Drawing.Size(29, 13);
     
    153175      //
    154176      this.indefiniteCheckBox.AutoSize = true;
    155       this.indefiniteCheckBox.Location = new System.Drawing.Point(278, 219);
     177      this.indefiniteCheckBox.Location = new System.Drawing.Point(278, 245);
    156178      this.indefiniteCheckBox.Name = "indefiniteCheckBox";
    157179      this.indefiniteCheckBox.Size = new System.Drawing.Size(69, 17);
    158       this.indefiniteCheckBox.TabIndex = 12;
     180      this.indefiniteCheckBox.TabIndex = 13;
    159181      this.indefiniteCheckBox.Text = "Indefinite";
    160182      this.indefiniteCheckBox.UseVisualStyleBackColor = true;
     
    163185      // createdTextBox
    164186      //
    165       this.createdTextBox.Location = new System.Drawing.Point(72, 164);
     187      this.createdTextBox.Location = new System.Drawing.Point(72, 190);
    166188      this.createdTextBox.Name = "createdTextBox";
    167189      this.createdTextBox.ReadOnly = true;
    168190      this.createdTextBox.Size = new System.Drawing.Size(200, 20);
    169       this.createdTextBox.TabIndex = 7;
     191      this.createdTextBox.TabIndex = 14;
    170192      //
    171193      // refreshButton
    172194      //
    173       this.refreshButton.Image = HeuristicLab.Common.Resources.VSImageLibrary.Refresh;
    174       this.refreshButton.Location = new System.Drawing.Point(72, 136);
     195      this.refreshButton.Image = ((System.Drawing.Image)(resources.GetObject("refreshButton.Image")));
     196      this.refreshButton.Location = new System.Drawing.Point(72, 162);
    175197      this.refreshButton.Name = "refreshButton";
    176198      this.refreshButton.Size = new System.Drawing.Size(24, 24);
     
    197219      this.Controls.Add(this.nameTextBox);
    198220      this.Controls.Add(this.nameLabel);
     221      this.Controls.Add(this.idTextBox);
     222      this.Controls.Add(this.idLabel);
    199223      this.Name = "ProjectView";
    200       this.Size = new System.Drawing.Size(539, 246);
     224      this.Size = new System.Drawing.Size(539, 271);
    201225      this.Load += new System.EventHandler(this.ProjectView_Load);
    202226      this.ResumeLayout(false);
     
    207231    #endregion
    208232
     233    private System.Windows.Forms.Label idLabel;
     234    protected System.Windows.Forms.TextBox idTextBox;
    209235    private System.Windows.Forms.Label nameLabel;
    210236    private System.Windows.Forms.TextBox nameTextBox;
  • branches/HiveProjectManagement/HeuristicLab.Clients.Hive.Administrator/3.3/Views/ProjectView.cs

    r15422 r15576  
    6767      base.OnContentChanged();
    6868      if (Content == null) {
     69        idTextBox.Clear();
    6970        nameTextBox.Clear();
    7071        descriptionTextBox.Clear();
     
    7576        indefiniteCheckBox.Checked = false;
    7677      } else {
     78        idTextBox.Text = Content.Id.ToString();
    7779        nameTextBox.Text = Content.Name;
    7880        descriptionTextBox.Text = Content.Description;
  • branches/HiveProjectManagement/HeuristicLab.Clients.Hive.Administrator/3.3/Views/ResourceView.cs

    r15567 r15576  
    5959      base.SetEnabledStateOfControls();
    6060      bool enabled = Content != null && !Locked;
    61       nameTextBox.Enabled = enabled;
    62       descriptionTextBox.Enabled = enabled;
    63       heartbeatIntervalNumericUpDown.Enabled = enabled;
     61      nameTextBox.ReadOnly = !enabled;
     62      descriptionTextBox.ReadOnly = !enabled;
     63      heartbeatIntervalNumericUpDown.ReadOnly = !enabled;
    6464      publicCheckBox.Enabled = enabled;
    6565    }
  • branches/HiveProjectManagement/HeuristicLab.Clients.Hive.Administrator/3.3/Views/ResourcesView.cs

    r15567 r15576  
    344344        }
    345345        newNode.SelectedImageIndex = newNode.ImageIndex;
    346         if (newResource.OwnerUserId == UserInformation.Instance.User.Id)
    347           newNode.BackColor = ownedResourceColor;
     346        //if (newResource.OwnerUserId == UserInformation.Instance.User.Id)
     347        //  newNode.BackColor = ownedResourceColor;
    348348      }
    349349
  • branches/HiveProjectManagement/HeuristicLab.Clients.Hive/3.3/HiveAdminClient.cs

    r15401 r15576  
    8888          service.GetSlaveGroups().ForEach(g => resources.Add(g));
    8989          service.GetSlaves().ForEach(s => resources.Add(s));
    90           service.GetProjects().ForEach(p => projects.Add(p));
     90          service.GetProjectsForAdministration().ForEach(p => projects.Add(p));
    9191        });
    9292      }
  • branches/HiveProjectManagement/HeuristicLab.Clients.Hive/3.3/ServiceClients/HiveServiceClient.cs

    r15412 r15576  
    7474       
    7575        public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
     76
    7677    }
    7778   
     
    23582359        System.Collections.Generic.List<HeuristicLab.Clients.Hive.Project> GetProjects();
    23592360       
     2361        [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IHiveService/GetProjectsForAdministration", ReplyAction="http://tempuri.org/IHiveService/GetProjectsForAdministrationResponse")]
     2362        System.Collections.Generic.List<HeuristicLab.Clients.Hive.Project> GetProjectsForAdministration();
     2363       
     2364        [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IHiveService/SaveProjectPermissions", ReplyAction="http://tempuri.org/IHiveService/SaveProjectPermissionsResponse")]
     2365        void SaveProjectPermissions(System.Guid projectId, System.Collections.Generic.List<System.Guid> grantedUserIds, bool reassign, bool cascading, bool reassignCascading);
     2366       
    23602367        [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IHiveService/GrantProjectPermissions", ReplyAction="http://tempuri.org/IHiveService/GrantProjectPermissionsResponse")]
    2361         void GrantProjectPermissions(System.Guid projectId, System.Collections.Generic.List<System.Guid> grantedUserIds);
     2368        void GrantProjectPermissions(System.Guid projectId, System.Collections.Generic.List<System.Guid> grantedUserIds, bool cascading);
    23622369       
    23632370        [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IHiveService/RevokeProjectPermissions", ReplyAction="http://tempuri.org/IHiveService/RevokeProjectPermissionsResponse")]
    2364         void RevokeProjectPermissions(System.Guid projectId, System.Collections.Generic.List<System.Guid> grantedUserIds);
     2371        void RevokeProjectPermissions(System.Guid projectId, System.Collections.Generic.List<System.Guid> grantedUserIds, bool cascading);
    23652372       
    23662373        [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IHiveService/GetProjectPermissions", ReplyAction="http://tempuri.org/IHiveService/GetProjectPermissionsResponse")]
    23672374        System.Collections.Generic.List<HeuristicLab.Clients.Hive.ProjectPermission> GetProjectPermissions(System.Guid projectId);
    23682375       
     2376        [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IHiveService/SaveProjectResourceAssignments", ReplyAction="http://tempuri.org/IHiveService/SaveProjectResourceAssignmentsResponse")]
     2377        void SaveProjectResourceAssignments(System.Guid projectId, System.Collections.Generic.List<System.Guid> resourceIds, bool reassign, bool cascading, bool reassignCascading);
     2378       
    23692379        [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IHiveService/AssignProjectResources", ReplyAction="http://tempuri.org/IHiveService/AssignProjectResourcesResponse")]
    2370         void AssignProjectResources(System.Guid projectId, System.Collections.Generic.List<System.Guid> resourceIds);
     2380        void AssignProjectResources(System.Guid projectId, System.Collections.Generic.List<System.Guid> resourceIds, bool cascading);
    23712381       
    23722382        [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IHiveService/UnassignProjectResources", ReplyAction="http://tempuri.org/IHiveService/UnassignProjectResourcesResponse")]
    2373         void UnassignProjectResources(System.Guid projectId, System.Collections.Generic.List<System.Guid> resourceIds);
     2383        void UnassignProjectResources(System.Guid projectId, System.Collections.Generic.List<System.Guid> resourceIds, bool cascading);
    23742384       
    23752385        [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IHiveService/GetAssignedResourcesForProject", ReplyAction="http://tempuri.org/IHiveService/GetAssignedResourcesForProjectResponse")]
     
    24352445        [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IHiveService/GetUserIdByUsername", ReplyAction="http://tempuri.org/IHiveService/GetUserIdByUsernameResponse")]
    24362446        System.Guid GetUserIdByUsername(string username);
     2447       
     2448        [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IHiveService/GetUserGroupTree", ReplyAction="http://tempuri.org/IHiveService/GetUserGroupTreeResponse")]
     2449        System.Collections.Generic.Dictionary<System.Guid, System.Collections.Generic.List<System.Guid>> GetUserGroupTree();
    24372450       
    24382451        [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IHiveService/GetUserPriorities", ReplyAction="http://tempuri.org/IHiveService/GetUserPrioritiesResponse")]
     
    26392652        }
    26402653       
    2641         public void GrantProjectPermissions(System.Guid projectId, System.Collections.Generic.List<System.Guid> grantedUserIds)
    2642         {
    2643             base.Channel.GrantProjectPermissions(projectId, grantedUserIds);
    2644         }
    2645        
    2646         public void RevokeProjectPermissions(System.Guid projectId, System.Collections.Generic.List<System.Guid> grantedUserIds)
    2647         {
    2648             base.Channel.RevokeProjectPermissions(projectId, grantedUserIds);
     2654        public System.Collections.Generic.List<HeuristicLab.Clients.Hive.Project> GetProjectsForAdministration()
     2655        {
     2656            return base.Channel.GetProjectsForAdministration();
     2657        }
     2658       
     2659        public void SaveProjectPermissions(System.Guid projectId, System.Collections.Generic.List<System.Guid> grantedUserIds, bool reassign, bool cascading, bool reassignCascading)
     2660        {
     2661            base.Channel.SaveProjectPermissions(projectId, grantedUserIds, reassign, cascading, reassignCascading);
     2662        }
     2663       
     2664        public void GrantProjectPermissions(System.Guid projectId, System.Collections.Generic.List<System.Guid> grantedUserIds, bool cascading)
     2665        {
     2666            base.Channel.GrantProjectPermissions(projectId, grantedUserIds, cascading);
     2667        }
     2668       
     2669        public void RevokeProjectPermissions(System.Guid projectId, System.Collections.Generic.List<System.Guid> grantedUserIds, bool cascading)
     2670        {
     2671            base.Channel.RevokeProjectPermissions(projectId, grantedUserIds, cascading);
    26492672        }
    26502673       
     
    26542677        }
    26552678       
    2656         public void AssignProjectResources(System.Guid projectId, System.Collections.Generic.List<System.Guid> resourceIds)
    2657         {
    2658             base.Channel.AssignProjectResources(projectId, resourceIds);
    2659         }
    2660        
    2661         public void UnassignProjectResources(System.Guid projectId, System.Collections.Generic.List<System.Guid> resourceIds)
    2662         {
    2663             base.Channel.UnassignProjectResources(projectId, resourceIds);
     2679        public void SaveProjectResourceAssignments(System.Guid projectId, System.Collections.Generic.List<System.Guid> resourceIds, bool reassign, bool cascading, bool reassignCascading)
     2680        {
     2681            base.Channel.SaveProjectResourceAssignments(projectId, resourceIds, reassign, cascading, reassignCascading);
     2682        }
     2683       
     2684        public void AssignProjectResources(System.Guid projectId, System.Collections.Generic.List<System.Guid> resourceIds, bool cascading)
     2685        {
     2686            base.Channel.AssignProjectResources(projectId, resourceIds, cascading);
     2687        }
     2688       
     2689        public void UnassignProjectResources(System.Guid projectId, System.Collections.Generic.List<System.Guid> resourceIds, bool cascading)
     2690        {
     2691            base.Channel.UnassignProjectResources(projectId, resourceIds, cascading);
    26642692        }
    26652693       
     
    27692797        }
    27702798       
     2799        public System.Collections.Generic.Dictionary<System.Guid, System.Collections.Generic.List<System.Guid>> GetUserGroupTree()
     2800        {
     2801            return base.Channel.GetUserGroupTree();
     2802        }
     2803       
    27712804        public System.Collections.Generic.List<HeuristicLab.Clients.Hive.UserPriority> GetUserPriorities()
    27722805        {
Note: See TracChangeset for help on using the changeset viewer.