summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJorge Hernandez <jorge.hernandez-herrero@att.com>2019-08-13 13:53:49 +0000
committerGerrit Code Review <gerrit@onap.org>2019-08-13 13:53:49 +0000
commit102d5151bc603961ebd2b232f97edb313f70b138 (patch)
treeec8756333fcee365bf905c77dd2955c9be31db52
parent80133d27f21e27c8da4b3e8d635fb2c05f2f7721 (diff)
parent971903e3b96068094b35ffa4207f025b7b569e51 (diff)
Merge "Fix issue for policies not loading on GUI push tab"
-rw-r--r--POLICY-SDK-APP/src/main/java/org/onap/policy/controller/AutoPushController.java10
1 files changed, 9 insertions, 1 deletions
diff --git a/POLICY-SDK-APP/src/main/java/org/onap/policy/controller/AutoPushController.java b/POLICY-SDK-APP/src/main/java/org/onap/policy/controller/AutoPushController.java
index 44a133068..a42d3d8d7 100644
--- a/POLICY-SDK-APP/src/main/java/org/onap/policy/controller/AutoPushController.java
+++ b/POLICY-SDK-APP/src/main/java/org/onap/policy/controller/AutoPushController.java
@@ -114,6 +114,13 @@ public class AutoPushController extends RestrictedBaseController {
return policyController != null ? getPolicyController() : new PolicyController();
}
+ private Set<String> addAllScopes(Roles userRole, Set<String> scopes) {
+ if (userRole.getScope() != null) {
+ scopes.addAll(Stream.of(userRole.getScope().split(",")).collect(Collectors.toSet()));
+ }
+ return scopes;
+ }
+
@RequestMapping(value = {"/get_AutoPushPoliciesContainerData"}, method = {RequestMethod.GET},
produces = MediaType.APPLICATION_JSON_VALUE)
public void getPolicyGroupContainerData(HttpServletRequest request, HttpServletResponse response) {
@@ -130,8 +137,9 @@ public class AutoPushController extends RestrictedBaseController {
for (Object role : userRoles) {
Roles userRole = (Roles) role;
roles.add(userRole.getRole());
- scopes.addAll(Stream.of(userRole.getScope().split(",")).collect(Collectors.toSet()));
+ addAllScopes(userRole, scopes);
}
+
if (roles.contains("super-admin") || roles.contains("super-editor") || roles.contains("super-guest")) {
data = commonClassDao.getData(PolicyVersion.class);
} else {