New basic User API

Following https://forum.xwiki.org/t/add-a-new-xwikiuser-displayhiddendocuments-api/6327 here’s a first basic API proposal so that we can move forward.

https://design.xwiki.org/xwiki/bin/view/Proposal/UserAPI

Notes:

  • My goal isn’t to provide a full API at this stage but if you see important missing methods or if you’d do things differently, let me know.
  • I have a first version of the implementation done (missing tests ATM).
  • @surli I’m not sure why we’d need https://jira.xwiki.org/browse/XWIKI-17012 since the goal of this API is to abstract from the implementation, i.e. users of the API shouldn’t need to care how the user is stored. Maybe your need is transient and only there because we don’t have a full user API yet? My POV is that we shouldn’t rely on the fact that a user is implemented in a wiki page. And if the need is transient it should go in some transient class but not in the new API proper. WDYT?

Feedback most welcome. I’m sure I’m missing stuff since I did this very quickly!

1 Like

I now have full unit tests for the new user api code :slight_smile:

And I have now locally on my computer modified all places in platform that were calling for displayHiddenDocuments so that it goes through te new API, thus cleaning implementing https://jira.xwiki.org/browse/XWIKI-9762

Just waiting for the go-ahead from other committers.

Well the need was more about being able to check that a user exist, with a reference to perform this checks. AFAICS your new design almost allows it: we just need an exist() method in UserManager which would take a UserReference.

So +1 for the new API with this method in it.

Implemented in http://jira.xwiki.org/browse/XWIKI-17069