diff options
Diffstat (limited to 'POLICY-SDK-APP/src/main/java/org/openecomp/policy/controller/PolicyExportAndImportController.java')
-rw-r--r-- | POLICY-SDK-APP/src/main/java/org/openecomp/policy/controller/PolicyExportAndImportController.java | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/POLICY-SDK-APP/src/main/java/org/openecomp/policy/controller/PolicyExportAndImportController.java b/POLICY-SDK-APP/src/main/java/org/openecomp/policy/controller/PolicyExportAndImportController.java index 68a65fc5e..bf2a148e6 100644 --- a/POLICY-SDK-APP/src/main/java/org/openecomp/policy/controller/PolicyExportAndImportController.java +++ b/POLICY-SDK-APP/src/main/java/org/openecomp/policy/controller/PolicyExportAndImportController.java @@ -89,6 +89,15 @@ public class PolicyExportAndImportController extends RestrictedBaseController { private Workbook workbook; private HSSFWorkbook workBook2; + + private PolicyController policyController; + public PolicyController getPolicyController() { + return policyController; + } + + public void setPolicyController(PolicyController policyController) { + this.policyController = policyController; + } @Autowired private PolicyExportAndImportController(CommonClassDao commonClassDao){ @@ -190,12 +199,12 @@ public class PolicyExportAndImportController extends RestrictedBaseController { String configName = null; String scope = null; boolean finalColumn = false; - PolicyController controller = new PolicyController(); + PolicyController controller = policyController != null ? getPolicyController() : new PolicyController(); String userId = UserUtils.getUserSession(request).getOrgUserId(); UserInfo userInfo = (UserInfo) commonClassDao.getEntityItem(UserInfo.class, "userLoginId", userId); //Check if the Role and Scope Size are Null get the values from db. - List<Object> userRoles = PolicyController.getRoles(userId); + List<Object> userRoles = controller.getRoles(userId); roles = new ArrayList<>(); scopes = new HashSet<>(); for(Object role: userRoles){ |