Add / remove users
PUT /v1/user_groups/{id}/users
[ {user reference}, {user reference}, ... ]
Where {user reference} can be one of:
- {"id": integer}
- {"username": string}
- {"email": string}
- {"ldap_id": string}
Note:
- for email, if 2 accounts share the same email adress, an error is thrown (4XX, to be defined)
- there can be only one entry in {user reference}, if one of the entry is {"id": 101, "username": "john"}, an error 4XX is thrown
This route will update the membership with the given list of users:
- Add missing users
- Remove users that are present in the group but not in the submitted array
- This is meant to be used for large groups (400 / 500 people)
- There is no notification of people (even for adding as project member)
- As for all other user manipulation regarding ldap: there is no need of prior log-in of people. As soon as someone exist in LDAP, she can be added into the group
Covered groups:
- works on all static and dynamic groups except Tracker v3 admins and global groups (registered users, ...).
Error management
By default, PUT /v1/user_groups/{id}/users will return 200 and process the list of user if all entries are valid:
- Format is valid
- Only one user match each entry (ie. there is no 2 accounts for a submitted email)
- all users are added/removed
As soon as there is an error, a 4XX error is return and nothing is changed. All errors are listed (ie. we don't stop at first error). Note: as all REST errors, yhere is no guarranty that error is parsable and stable, it's meant for a human analysis.
Technical aspects
- UserManager::getUserByIdentifier should already do part of the job regarding ldap_id (but we have to ensure it does an LDAP lookup if the ldap_id is not already present in Tuleap)
- Team forecast weird egde cases due to the mix groups (static/dynamic) and the mixed nature of input