aboutsummaryrefslogtreecommitdiffstats
path: root/vid-app-common/src/main/java/org/onap/vid/roles/RoleProvider.java
diff options
context:
space:
mode:
Diffstat (limited to 'vid-app-common/src/main/java/org/onap/vid/roles/RoleProvider.java')
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/roles/RoleProvider.java34
1 files changed, 26 insertions, 8 deletions
diff --git a/vid-app-common/src/main/java/org/onap/vid/roles/RoleProvider.java b/vid-app-common/src/main/java/org/onap/vid/roles/RoleProvider.java
index 45835d459..5c1ee9e89 100644
--- a/vid-app-common/src/main/java/org/onap/vid/roles/RoleProvider.java
+++ b/vid-app-common/src/main/java/org/onap/vid/roles/RoleProvider.java
@@ -1,3 +1,23 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Modifications Copyright 2018 Nokia
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
package org.onap.vid.roles;
import com.fasterxml.jackson.core.JsonProcessingException;
@@ -16,8 +36,6 @@ import org.springframework.stereotype.Component;
import javax.servlet.http.HttpServletRequest;
import java.util.*;
-//import org.codehaus.jackson.map.ObjectMapper;
-
/**
* Created by Oren on 7/1/17.
*/
@@ -45,16 +63,16 @@ public class RoleProvider {
LOG.debug(EELFLoggerDelegate.debugLogger, "Role provider => init method finished");
}
- public List<Role> getUserRoles(HttpServletRequest request) throws JsonProcessingException {
+ public List<Role> getUserRoles(HttpServletRequest request) {
String logPrefix = "Role Provider (" + UserUtils.getUserId(request) + ") ==>";
LOG.debug(EELFLoggerDelegate.debugLogger, logPrefix + "Entering to get user role for user " + UserUtils.getUserId(request));
List<Role> roleList = new ArrayList<>();
- //Disable roles until AAF integration finishes
- /*HashMap roles = UserUtils.getRoles(request);
+
+ Map roles = UserUtils.getRoles(request);
for (Object role : roles.keySet()) {
- org.openecomp.portalsdk.core.domain.Role sdkRol = (org.openecomp.portalsdk.core.domain.Role) roles.get(role);
+ org.onap.portalsdk.core.domain.Role sdkRol = (org.onap.portalsdk.core.domain.Role) roles.get(role);
LOG.debug(EELFLoggerDelegate.debugLogger, logPrefix + "Role " + sdkRol.getName() + " is being proccessed");
try {
@@ -67,11 +85,11 @@ public class RoleProvider {
roleList.add(createRoleFromStringArr(roleParts, logPrefix));
String msg = String.format(logPrefix + " User %s got permissions %s", UserUtils.getUserId(request), Arrays.toString(roleParts));
LOG.debug(EELFLoggerDelegate.debugLogger, msg);
- } catch (RoleParsingException e) {
+ } catch (Exception e) {
LOG.error(logPrefix + " Failed to parse permission");
}
- }*/
+ }
return roleList;
}