Specific code question regarding UserAccountDAO.java

in the UserAccountDAO class in getEntityFromHashMap you have code that excludes loading roles for users with a period in the username.. is there a reason for this? I would be using email addresses for usernames

if (!userName.contains(".")){
ArrayList userRoleBeans = (ArrayList) this.findAllRolesByUserName(eb.getName());
eb.setRoles(userRoleBeans);
}

Comments

  • toskriptoskrip Posts: 265 ✭✭
    Hey,

    I think this was introduced in order to support automatic user account creation for patients reporting their outcomes via OC Participate. In this case such user account is only relevant for data submission and cannot be used for login, so it does not have any particular role associated.

    the username for such automated patient account was constructed as:
    studyBean.getOid() + "." + studySubjectBean.getOid()

    in newest version of OC now there is a web service which Participate use to create the user accounts for patients, however the user name is still provided in a fashion I described above.

    hope it helps

    Tomas
  • gpinkhamgpinkham Posts: 37
    Thanks Tomas.. for my use I removed that code.. was worried it might cause another unknown issue.. good to see it won't.. (I connected openclinica community to my oauth provider I wrote.. and for that I use email for username..)

    thanks for the quick response!
    Gary
Sign In or Register to comment.