Changeset 15580


Ignore:
Timestamp:
01/08/18 12:45:15 (11 months ago)
Author:
jzenisek
Message:

#2839

  • minor bugfix in HiveService.cs
  • corrected behavior of ProjectPermissionsView
Location:
branches/HiveProjectManagement
Files:
5 edited

Legend:

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

    r15576 r15580  
    7474      idTextBox.ReadOnly = !enabled;
    7575      storeButton.Enabled = enabled;
    76       refreshableLightweightUserView.Enabled = enabled;
    77       //refreshableLightweightUserView.Locked = !enabled;
     76      //refreshableLightweightUserView.Enabled = enabled;
     77      refreshableLightweightUserView.Locked = !enabled;
    7878      //refreshableLightweightUserView.ReadOnly = !enabled;
    7979    }
     
    102102
    103103    private void Content_Refreshing(object sender, EventArgs e) {
    104       storeButton.Enabled = false;
     104      if (!Locked) storeButton.Enabled = false;
    105105    }
    106106
    107107    private void refreshableLightweightUserView_StorableStateChanged(object sender, EventArgs e) {
    108       storeButton.Enabled = true;
     108      if (!Locked) storeButton.Enabled = true;
    109109    }
    110110  }
  • branches/HiveProjectManagement/HeuristicLab.Clients.Access.Views/3.3/UserViews/LightweightUserView.cs

    r14185 r15580  
    5959      base.SetEnabledStateOfControls();
    6060      this.showDetailsCheckBox.Enabled = false;
     61      bool enabled = Content != null && !Locked;
     62      addButton.Enabled = enabled;
     63      removeButton.Enabled = enabled;
     64      moveDownButton.Enabled = enabled;
     65      moveUpButton.Enabled = enabled;
    6166    }
    6267
  • branches/HiveProjectManagement/HeuristicLab.Clients.Access.Views/3.3/UserViews/RefreshableLightweightUserView.cs

    r14185 r15580  
    5858    }
    5959
     60    protected override void SetEnabledStateOfControls() {
     61      base.SetEnabledStateOfControls();
     62      refreshButton.Enabled = FetchSelectedUsers != null && Content != null;
     63      lightweightUserView.Locked = Locked;
     64    }
     65
    6066    protected override void RefreshData() {
    6167      Action completeRefreshAction = new Action(delegate {
     
    7985        if (lightweightUserView.Content != null) OnStorableStateChanged();
    8086      }
    81     }
    82 
    83     protected override void SetEnabledStateOfControls() {
    84       base.SetEnabledStateOfControls();
    85       refreshButton.Enabled = FetchSelectedUsers != null && Content != null;
    8687    }
    8788
  • branches/HiveProjectManagement/HeuristicLab.Clients.Hive.Administrator/3.3/Views/ProjectPermissionsView.cs

    r15576 r15580  
    4444    private readonly Dictionary<Guid, HashSet<UserGroupBase>> userGroupDescendants = new Dictionary<Guid, HashSet<UserGroupBase>>();
    4545
     46    private IEnumerable<UserGroupBase> addedPermissions;
     47    private IEnumerable<UserGroupBase> removedPermissions;
     48    private IEnumerable<UserGroupBase> addedIncludes;
     49    private IEnumerable<UserGroupBase> removedIncludes;
     50
    4651    private readonly Color addedAssignmentColor = Color.FromArgb(255, 87, 191, 193); // #57bfc1
    4752    private readonly Color removedAssignmentColor = Color.FromArgb(255, 236, 159, 72); // #ec9f48
     
    215220
    216221    private UserGroupBase BuildPermissionsList(IEnumerable<UserGroupBase> usersAndGroups) {
     222      addedPermissions = newAssignedPermissions.Except(assignedPermissions);
     223      removedPermissions = assignedPermissions.Except(newAssignedPermissions);
     224      addedIncludes = newInheritedPermissions.Except(inheritedPermissions);
     225      removedIncludes = inheritedPermissions.Except(newInheritedPermissions);
     226
    217227      treeView.Nodes.Clear();
    218228      if (!usersAndGroups.Any()) return null;
     
    259269
    260270    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);
    265271
    266272      if (newAssignedPermissions.Contains(ug)) {
  • branches/HiveProjectManagement/HeuristicLab.Services.Hive/3.3/HiveService.cs

    r15577 r15580  
    861861              // remove project permissions
    862862              if(reassignCascading) {
    863                 p.AssignedProjectResources.Clear();
     863                p.ProjectPermissions.Clear();
    864864              } else {
    865865                foreach(var item in p.ProjectPermissions.ToList().Where(x => removedPermissions.Contains(x.GrantedUserId))) {
Note: See TracChangeset for help on using the changeset viewer.