Change in contract in /users api

Hi Lars,

We are on revision number 17565 of DHIS branch. And we noticed that , the structure of the user json has been changed, i.e the “userAuthorityGroups” field has been changed to “userRoles”.
Is there any particular reason for this change ? .
Also , what about the backward compatibility in this case ? , we already have a large number of users in our production database that have been created in accordance with the older api. Any suggestions as to how this migration can be done for the existing users ?

···

Sandesh DoolipetaApplication Developer
Email
sandeshd@thoughtworks.com

Telephone
9686062727

ThoughtWorks

Hi

This was changed since it was actually a bug in the naming, it should have been userRoles from the start (and this is reflected other places).

There shouldn’t be a need for a migration path though? unless you mean for old code? for the users themselves, nothing has changed internally (same database tables etc), so it should be easy as changing userAuthorityGroups to userRoles in your code.

I can probably provide a setter for userAuthorityGroups (which just points to userRoles) if you want, but even better if you can just change the code, let me know.

···

On Mon, Nov 24, 2014 at 11:58 AM, Sandesh Sukumar Doolipeta sandeshd@thoughtworks.com wrote:

Hi Lars,


Sandesh DoolipetaApplication Developer
Email
sandeshd@thoughtworks.com

Telephone
9686062727

ThoughtWorks

We are on revision number 17565 of DHIS branch. And we noticed that , the structure of the user json has been changed, i.e the “userAuthorityGroups” field has been changed to “userRoles”.
Is there any particular reason for this change ? .
Also , what about the backward compatibility in this case ? , we already have a large number of users in our production database that have been created in accordance with the older api. Any suggestions as to how this migration can be done for the existing users ?


Morten

Hi Sandesh,

yes sorry for the change - like Morten says this was a slip from the
beginning. We have not changed anything in the database though so your
existing users will be fine.

regards,

Lars