[PORTAL-876] pushing code for allowing non human users. 36/105936/1
authorMuni Mohan Kunchi <munmohan@att.com>
Tue, 14 Apr 2020 18:23:15 +0000 (14:23 -0400)
committerMuni Mohan Kunchi <munmohan@att.com>
Tue, 14 Apr 2020 18:24:12 +0000 (14:24 -0400)
pushing code for allowing non human users.

Issue-ID: PORTAL-876
Signed-off-by: Muni Mohan Kunchi <munmohan@att.com>
Change-Id: I26411bc985caeec782f67dfa1683b055ca27bc35

ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/UserRolesCommonServiceImpl.java

index e5ce206..4924e65 100644 (file)
@@ -200,7 +200,12 @@ public class UserRolesCommonServiceImpl  {
                                        client = new EPUser();
                                        client.setOrgUserId(userId);
                                        client.setSystemUser(true);
-                                       client.setFirstName(userId.substring(0,userId.indexOf("@")));
+                                       if (userId.indexOf("@") != -1) {
+                                               client.setFirstName(userId.substring(0,userId.indexOf("@")));
+                                       }
+                                       else {
+                                               client.setFirstName(userId);
+                                       }
                                }
                                if (client == null) {
                                        String msg = "createLocalUserIfNecessary: cannot create user " + userId