enonic / xp

Enonic XP
https://enonic.com
GNU General Public License v3.0
202 stars 34 forks source link

Administrator role is persisted when user is deleted and re-created #6201

Closed RF0 closed 6 years ago

RF0 commented 6 years ago

Environment: Enonic XP 6.14.1 ldap-id-provider 1.0.3

  1. Create user by logging in (ldap-id-provider)
  2. Add role 'Administrator' to user
  3. Delete user
  4. Create same user by logging in (ldap-id-provider)
  5. User still have 'Administrator' role
sigdestad commented 6 years ago

Re-creating a user with the same "name" in XP, effectively makes him the same user (including content permissions/ownerships) - however, he should not get the old roles etc.

We should consider not making it possible to delete the user, but only disable?

GlennRicaud commented 6 years ago

I cannot reproduce this in 6.14.1 or 6.15-SNAPSHOT

At step 2, you modify the role 'Administrator', add a user X and save. => You can see the user X listed in the list of members in the details of the role 'Administrator' At step 3, you delete the user X => The user X is not displayed in the list of members At step 4, you login with the user X credentials => The user X is created

=> The user X is listed in the list of members ?

GlennRicaud commented 6 years ago

@RF0 Can you confirm the last point

GlennRicaud commented 6 years ago

Reproduced with Rfo. This is due to the use of upper case in the name of users. The user is not removed from groups/roles on the deletion of the user

GlennRicaud commented 6 years ago

Useful old 2016/2017 issues for background: issue XP-4687 -> #4150,#4156 issue #4462

To get from this: PrincipalKeys are a concatenation of type + userstore + name. So they can have uppercase letters (ex: user:system:AA). Principal IDs cannot be trusted since depending on the version they were created they might be lowercased or not. Today they are lowercased (ex: user:system:aa). Second issue fixes this by searching by path. (ex: /identity/system/users/AA)

After testing the problem comes form admin UI and not runtime. The key passed for deletion is lowercased (maybe taken from the ID). Fix there. Try manually with GraphiQL and it fixes the problem. Will create an issue in app-users

GlennRicaud commented 6 years ago

Will be fixed in https://github.com/enonic/app-users/issues/85