Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
08/02/18 16:58:48 (6 years ago)
Author:
jzenisek
Message:

#2839: fixed handling of project related updates for project owners, who are no admins and do not own parent projects

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2839_HiveProjectManagement/HeuristicLab.Clients.Hive.Administrator/3.3/Views/ProjectView.cs

    r15992 r16040  
    111111      endDateTimePicker.Enabled = enabled && Content.EndDate.HasValue;
    112112      indefiniteCheckBox.Enabled = enabled;
     113
     114      if (!IsAdmin() && !HiveAdminClient.Instance.CheckOwnershipOfParentProject(Content, UserInformation.Instance.User.Id)) {
     115        ownerComboBox.Enabled = false;
     116        startDateTimePicker.Enabled = false;
     117        endDateTimePicker.Enabled = false;
     118        indefiniteCheckBox.Enabled = false;
     119      }
    113120    }
    114121    #endregion
     
    198205    private void startDateTimePicker_ValueChanged(object sender, EventArgs e) {
    199206      if (Content == null) return;
     207 
    200208      if (!Content.EndDate.HasValue || startDateTimePicker.Value > Content.EndDate)
    201209        endDateTimePicker.Value = startDateTimePicker.Value;
     
    206214    private void endDateTimePicker_ValueChanged(object sender, EventArgs e) {
    207215      if (Content == null) return;
     216
    208217      if (endDateTimePicker.Value < startDateTimePicker.Value)
    209218        endDateTimePicker.Value = startDateTimePicker.Value;
     
    214223    private void indefiniteCheckBox_CheckedChanged(object sender, EventArgs e) {
    215224      if (Content == null) return;
     225
    216226      var newEndDate = indefiniteCheckBox.Checked ? (DateTime?)null : endDateTimePicker.Value;
    217227      endDateTimePicker.Enabled = !indefiniteCheckBox.Checked;
     
    233243    }
    234244
     245    private bool IsAdmin() {
     246      return HiveRoles.CheckAdminUserPermissions();
     247    }
     248
    235249    private void ShowHiveInformationDialog() {
    236250      if (InvokeRequired) Invoke((Action)ShowHiveInformationDialog);
Note: See TracChangeset for help on using the changeset viewer.