Deliver centralized role management feature
[portal.git] / ecomp-portal-widget-ms / widget-ms / src / main / java / org / openecomp / portalapp / widget / service / impl / WidgetCatalogServiceImpl.java
@@ -57,9 +57,12 @@ public class WidgetCatalogServiceImpl implements WidgetCatalogService {
                                .append("  ep_widget_catalog w,                                                                                                                                            ")
                                .append("  ep_widget_catalog_role wr,                                                                                                                                              ")
                                .append("  fn_user_role ur,                                                                                                                                                                                                                                                                                ")
+                               .append("  fn_app app,                                                                                                                                                                                                                                                                             ")
                                .append("  fn_user u                                                                                                                                                               ")
                                .append("  where                                                                                                                                                   ")
                                .append("  w.widget_id = wr.WIDGET_ID and                                                                                                                                                                                                                                                  ")
+                               .append("  ur.app_id = app.app_id and                                                                                                                                                                                                                                              ")
+                               .append("  app.enabled = 'Y' and                                                                                                                                                                                                                                                   ")
                                .append("  wr.role_id = ur.role_id and                                                                                                                                                                                                                                             ")                                                                                                            
                                .append("  ur.user_id = u.user_id and                                                                                                                                                                                                                                              ")                                                                                                              
                                .append("  u.login_id = '" + loginName + "' and (w.all_user_flag = 'N' or w.all_user_flag is null)                                                                 ")