pydio / pydio-core

Pydio 8 official repository
https://pydio.com
GNU Affero General Public License v3.0
867 stars 289 forks source link

REST API : Bad setting of groupPath when creating a user at the root #1333

Closed berardd closed 7 years ago

berardd commented 7 years ago

Hello guys,

This issue is open at the request of Charles after the forum post below. https://pydio.com/forum/f/topic/rest-api-people-provisionning/#post-109049

OS : Ubuntu 14.04 LTS Pydio : 7.0.4 (7.0.4-1ubuntu1~14.04)

When I try to create a user with the REST API at the root level $ curl -u admin:password -X POST --url 'https://pydio.example.com/pydio/api/v2/admin/people/user1@example.com?format=json&resourceType=user&userPass=password' {"reload":{"node":"","pendingSelection":"user1@example.com"},"message":{"level":"Info","message":"L'utilisateur a \u00e9t\u00e9 cr\u00e9\u00e9 avec succ\u00e8s"}}

The user is not visible in the GUI, but if I try to recreate the user (with the same command), Pydio respond "User already exists".

If I look in the MySQL database, I see my new user in the ajxp_users table. But, contrary to the other users (at the root level), the column “groupPath” is equal to “/.” (“/” for the others users). If I modify the groupPath (setting it to '/'), clear the cache, the user appeared in the GUI.

If I add a supplementary '/' in the URL (/api/v2/admin/people//user1@example.com instead of /api/v2/admin/people/user1@example.com), the user is correctly create with a groupPath='/'.

Thank you.

Best regards David.

berardd commented 7 years ago

Sorry, closed by mistake...

David.