Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set "can admin" permission on LDAP users and teams correctly #1152

Merged
merged 1 commit into from Nov 18, 2016

Conversation

flaix
Copy link
Member

@flaix flaix commented Nov 18, 2016

The canAdmin permission is set on a LDAP user, when the user is listed
in realm.ldap.admins or is a member of a team listed in realm.ldap.admins.
This leads to inconsistent and surprising behaviour on the EditUser page
when clicking the "can admin" checkbox. Also, the "can admin" checkbox
is disabled, but not checked, for teams that are listed as admin teams.

The new behaviour implemented in this patch makes users and teams from
LDAP match local ones. That means:

  • LDAP teams that are listed in realm.ldap.admins get the canAdmin
    property set if teams are maintained in LDAP.
  • LDAP users that are listed in realm.ldap.admins get the canAdmin
    property set if teams are maintained in LDAP.
  • LDAP users do not get the canAdmin property set, if they are only a
    member of a team listed in realm.ldap.admins.
  • The supportsRoleChanges method for users and teams of the
    LdapAuthProvider unconditially returns false if teams are
    maintained in LDAP, not only for users and teams listed in
    realm.ldap.admins.
  • Therefore, for all LDAP users and teams the "can admin" checkbox
    is always disabled if teams are maintained in LDAP.

The canAdmin permission is set on a LDAP user, when the user is listed
in `realm.ldap.admins` or is a member of a team listed in `realm.ldap.admins`.
This leads to inconsistent and surprising behaviour on the EditUser page
when clicking the "can admin" checkbox. Also, the "can admin" checkbox
is disabled, but not checked, for teams that are listed as admin teams.

The new behaviour implemented in this patch makes users and teams from
LDAP match local ones. That means:
* LDAP teams that are listed in `realm.ldap.admins` get the canAdmin
  property set if teams are maintained in LDAP.
* LDAP users that are listed in `realm.ldap.admins` get the canAdmin
  property set if teams are maintained in LDAP.
* LDAP users do not get the canAdmin property set, if they are only a
  member of a team listed in `realm.ldap.admins`.
* The `supportsRoleChanges` method for users and teams of the
  `LdapAuthProvider` unconditially returns false if teams are
  maintained in LDAP, not only for users and teams listed in
  `realm.ldap.admins`.
* Therefore, for all LDAP users and teams the "can admin" checkbox
  is always disabled if teams are maintained in LDAP.
@gitblit gitblit merged commit 6b0ac41 into gitblit-org:master Nov 18, 2016
@gitblit
Copy link
Collaborator

gitblit commented Nov 18, 2016

Nice. 👍

@flaix flaix added this to the 1.9.0 milestone Dec 13, 2016
@flaix flaix deleted the fixAdminRoleLDAP branch June 16, 2019 09:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants