Cannot update a group member permission level

Summary

Whenever we have a LDAP sync with a group and we override the permissions as in https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/822 The problem comes whenever there is a sync with LDAP, because after that the member permissions cannot be modified anymore unless you remove the "disable" from the select.

Steps to reproduce

  1. Have a group with LDAP sync
  2. Change the permissions of a member to override them
  3. Refresh page
  4. See that the permission dropdown and expiration is incorrectly disabled

What is the current bug behavior?

ldap_sync If the permission has been manually changed, the select is disabled.

What is the expected correct behavior?

If the permission has been manually changed, the select should not be disabled.

Edited by Michael Kozono