fixes for non gui application 26/109126/1
authorMuni Mohan Kunchi <munmohan@att.com>
Fri, 12 Jun 2020 18:51:05 +0000 (14:51 -0400)
committerMuni Mohan Kunchi <munmohan@att.com>
Fri, 12 Jun 2020 18:51:34 +0000 (14:51 -0400)
Issue-ID: PORTAL-909
Signed-off-by: Muni Mohan Kunchi <munmohan@att.com>
Change-Id: Ia006bc755760641c6501a531f95013d04c93427f

ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/EPAppCommonServiceImpl.java
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/UserRolesCommonServiceImpl.java
ecomp-portal-BE-common/src/main/webapp/WEB-INF/fusion/orm/EP.hbm.xml

index 539ada2..8319dab 100644 (file)
@@ -855,7 +855,8 @@ public class EPAppCommonServiceImpl implements EPAppService {
        public List<OnboardingApp> getEnabledNonOpenOnboardingApps() {
                @SuppressWarnings("unchecked")
                List<EPApp> apps = dataAccessService.getList(EPApp.class,
-                               " where enabled = true and open = false and id!=" + ECOMP_APP_ID, null, null);
+                               " where enabled = true and open = false and app_type!= 3 and id!=" + ECOMP_APP_ID, null, null);
+       
                List<OnboardingApp> onboardingAppsList = new ArrayList<OnboardingApp>();
                for (EPApp app : apps) {
                        OnboardingApp onboardingApp = new OnboardingApp();
index db86005..a97dc58 100644 (file)
@@ -1086,7 +1086,6 @@ public class UserRolesCommonServiceImpl  {
                                                }
                                        }
                                }
-                                       
                                applyChangesToUserAppRolesForMyLoginsRequest(user, appId);
 
                                Boolean systemUser = (newAppRolesForUser.getIsSystemUser() != null ? newAppRolesForUser.getIsSystemUser() : false);
@@ -1114,7 +1113,10 @@ public class UserRolesCommonServiceImpl  {
                                }
                                else{   // if centralized app
                                if (app.getRolesInAAF()) {
-                                       if (!app.getId().equals(PortalConstants.PORTAL_APP_ID)) {
+                               
+                                       if (!app.getId().equals(PortalConstants.PORTAL_APP_ID) && (app.getAppAck() != null && app.getAppAck())) {
+                                               logger.debug(EELFLoggerDelegate.debugLogger,"setAppWithUserRoleStateForUser: calling pushRemoteUser method for Central application");
+                                               logger.debug(EELFLoggerDelegate.debugLogger,"setAppWithUserRoleStateForUser:"+app.getAppAck());
                                                pushRemoteUser(roleInAppForUserList, userId, app, mapper, searchService,
                                                                        applicationsRestClientService,false);
                                        }
@@ -1125,8 +1127,8 @@ public class UserRolesCommonServiceImpl  {
                                                        userRolesInLocalApp);
                                        List<RoleInAppForUser> roleAppUserList = rolesInAppForUser.roles;
                                        if (EcompPortalUtils.checkIfRemoteCentralAccessAllowed()) {
-                                               
-                                               // Apply changes in external Access system
+
+                                       // Apply changes in external Access system
                                                updateUserRolesInExternalSystem(app, rolesInAppForUser.orgUserId, roleAppUserList,
                                                                epRequestValue,false,rolesGotDeletedFromApprover,checkIfUserisOnlyRoleAdmin);
                                        }
index 5401ee9..577871d 100644 (file)
@@ -1258,7 +1258,7 @@ where fn_role.app_id = fn_app.app_id and fn_app.enabled='Y' and fn_role.active_y
                                a.ML_APP_NAME           , a.ML_APP_ADMIN_ID , a.MOTS_ID                         , a.APP_PASSWORD ,
                        a.THUMBNAIL             , a.APP_USERNAME        , a.OPEN                                , a.ENABLED , 
                                a.UEB_TOPIC_NAME        , a.UEB_KEY             , a.UEB_SECRET                  , a.APP_TYPE          , a.AUTH_CENTRAL ,
-                               a.AUTH_NAMESPACE
+                               a.AUTH_NAMESPACE        , a.MODE_OF_INTEGRATION, a.ACK_APP                      , a.USES_CADI
                    from FN_APP a
                    -- Portal assigns role 999 to app administrator                 
                        left outer join FN_USER_ROLE         r ON a.APP_ID = r.APP_ID and r.USER_ID = :userId and r.ROLE_ID != 999
@@ -1278,7 +1278,7 @@ where fn_role.app_id = fn_app.app_id and fn_app.enabled='Y' and fn_role.active_y
                                b.ML_APP_NAME           , b.ML_APP_ADMIN_ID , b.MOTS_ID                         , b.APP_PASSWORD ,
                        b.THUMBNAIL             , b.APP_USERNAME        , b.OPEN                                , b.ENABLED , 
           b.UEB_TOPIC_NAME     , b.UEB_KEY             , b.UEB_SECRET                  , b.APP_TYPE         , b.AUTH_CENTRAL ,
-          b.AUTH_NAMESPACE
+          b.AUTH_NAMESPACE     , b.MODE_OF_INTEGRATION         , b.ACK_APP             , b.USES_CADI
           from fn_user_role a, fn_app b, ep_app_role_function c   , fn_role d , ep_app_function e
           where a.user_id =:userId  and b.app_id = c.app_id and a.app_id = c.role_app_id and b.enabled = 'Y' and c.role_id = d.role_id and d.active_yn='Y' and a.role_id = d.role_id and e.app_id = c.app_id
                  order by app_name
@@ -1299,7 +1299,7 @@ where fn_role.app_id = fn_app.app_id and fn_app.enabled='Y' and fn_role.active_y
                                a.ML_APP_NAME           , a.ML_APP_ADMIN_ID , a.MOTS_ID                         , a.APP_PASSWORD ,
                        a.THUMBNAIL             , a.APP_USERNAME        , a.OPEN                                , a.ENABLED , 
                                a.UEB_TOPIC_NAME        , a.UEB_KEY             , a.UEB_SECRET                  , a.APP_TYPE         , a.AUTH_CENTRAL ,
-                               a.AUTH_NAMESPACE
+                               a.AUTH_NAMESPACE        , a.MODE_OF_INTEGRATION, a.ACK_APP                      , a.USES_CADI
                    from FN_APP a
                    -- Portal assigns role 999 to app administrator                 
                        left outer join FN_USER_ROLE         r ON a.APP_ID = r.APP_ID and r.USER_ID = :userId and r.ROLE_ID != 999
@@ -1317,7 +1317,7 @@ where fn_role.app_id = fn_app.app_id and fn_app.enabled='Y' and fn_role.active_y
                                b.ML_APP_NAME           , b.ML_APP_ADMIN_ID , b.MOTS_ID                         , b.APP_PASSWORD ,
                        b.THUMBNAIL             , b.APP_USERNAME        , b.OPEN                                , b.ENABLED , 
           b.UEB_TOPIC_NAME     , b.UEB_KEY             , b.UEB_SECRET                  , b.APP_TYPE         , b.AUTH_CENTRAL ,
-          b.AUTH_NAMESPACE
+          b.AUTH_NAMESPACE     , b.MODE_OF_INTEGRATION, b.ACK_APP                      , b.USES_CADI
           from fn_user_role a, fn_app b, ep_app_role_function c   , fn_role d , ep_app_function e
           where a.user_id =:userId  and b.app_id = c.app_id and a.app_id = c.role_app_id and b.enabled = 'Y' and c.role_id = d.role_id and d.active_yn='Y' and a.role_id = d.role_id and e.app_id = c.app_id
                order by app_name
@@ -1629,7 +1629,11 @@ where fn_role.app_id = fn_app.app_id and fn_app.enabled='Y' and fn_role.active_y
                            a.APP_ID as id, a.APP_NAME as name, a.ML_APP_NAME as mlAppName, a.APP_IMAGE_URL as imageUrl,
                            a.APP_DESCRIPTION as description, a.APP_NOTES as notes,
                            a.APP_URL as url, a.APP_ALTERNATE_URL as alternateUrl,
-                               IF(a.app_type = '2', TRUE, FALSE) as restricted,
+                               -- IF(a.app_type = '2', TRUE, FALSE) as restricted,
+                               case
+                                       when a.app_type = '2' and a.app_type = '3' then TRUE
+                                       else FALSE
+                               end as restricted,
                            IF(a.open = 'Y', TRUE, FALSE) as open,
                 -- ACCESS(-ible) means user has a defined role OR the application is open 
                                case