aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSonsino, Ofir (os0695) <os0695@intl.att.com>2018-11-01 19:22:47 +0200
committerOfir Sonsino <ofir.sonsino@intl.att.com>2018-11-05 19:00:41 +0000
commitae6315fe84629d67aff39cf5100ab81b94c781d7 (patch)
treea8f2ca584b47dfa5e420ed27976d958d77eddcbc
parente4c1493b35c4a3f3ee2232eccdf8e254ede74a85 (diff)
Enable role management
Change-Id: I08915fffa5da50c957d2f80ce88ef279fef3a1b2 Issue-ID: VID-257 Signed-off-by: Sonsino, Ofir (os0695) <os0695@intl.att.com>
-rwxr-xr-xepsdk-app-onap/src/main/resources/vid-data.sql13
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/controllers/VidController.java4
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/roles/RoleProvider.java8
3 files changed, 18 insertions, 7 deletions
diff --git a/epsdk-app-onap/src/main/resources/vid-data.sql b/epsdk-app-onap/src/main/resources/vid-data.sql
index e2af216e6..9c48f853b 100755
--- a/epsdk-app-onap/src/main/resources/vid-data.sql
+++ b/epsdk-app-onap/src/main/resources/vid-data.sql
@@ -625,6 +625,12 @@ REPLACE INTO `fn_restricted_url` VALUES ('serviceModels.htm','menu_servicemodels
--
INSERT INTO `fn_role` VALUES (1,'System Administrator','Y',1) ON DUPLICATE KEY UPDATE ROLE_NAME='System Administrator', ACTIVE_YN='Y', PRIORITY=1;
INSERT INTO `fn_role` VALUES (16,'Standard User','Y',5) ON DUPLICATE KEY UPDATE ROLE_NAME='Standard User', ACTIVE_YN='Y', PRIORITY=5;
+INSERT INTO `fn_role` VALUES (17,'Demonstration___vFWCL','Y',5) ON DUPLICATE KEY UPDATE ROLE_NAME='Demonstration___vFWCL', ACTIVE_YN='Y', PRIORITY=5;
+INSERT INTO `fn_role` VALUES (18,'Demonstration___vFW','Y',5) ON DUPLICATE KEY UPDATE ROLE_NAME='Demonstration___vFW', ACTIVE_YN='Y', PRIORITY=5;
+INSERT INTO `fn_role` VALUES (19,'Demonstration___vCPE','Y',5) ON DUPLICATE KEY UPDATE ROLE_NAME='Demonstration___vCPE', ACTIVE_YN='Y', PRIORITY=5;
+INSERT INTO `fn_role` VALUES (20,'Demonstration___vIMS','Y',5) ON DUPLICATE KEY UPDATE ROLE_NAME='Demonstration___vIMS', ACTIVE_YN='Y', PRIORITY=5;
+INSERT INTO `fn_role` VALUES (21,'Demonstration___vLB','Y',5) ON DUPLICATE KEY UPDATE ROLE_NAME='Demonstration___vLB', ACTIVE_YN='Y', PRIORITY=5;
+INSERT INTO `fn_role` VALUES (22,'Demonstration___gNB','Y',5) ON DUPLICATE KEY UPDATE ROLE_NAME='Demonstration___gNB', ACTIVE_YN='Y', PRIORITY=5;
--
-- Dumping data for table `fn_role_composite`
@@ -735,3 +741,10 @@ INSERT IGNORE `fn_user_role` VALUES (2,1,NULL,1);
INSERT IGNORE `fn_user_role` VALUES (3,1,NULL,1);
INSERT IGNORE `fn_user_role` VALUES (4,1,NULL,1);
INSERT IGNORE `fn_user_role` VALUES (5,1,NULL,1);
+INSERT IGNORE `fn_user_role` VALUES (1,17,NULL,1);
+INSERT IGNORE `fn_user_role` VALUES (1,18,NULL,1);
+INSERT IGNORE `fn_user_role` VALUES (1,19,NULL,1);
+INSERT IGNORE `fn_user_role` VALUES (1,20,NULL,1);
+INSERT IGNORE `fn_user_role` VALUES (1,21,NULL,1);
+INSERT IGNORE `fn_user_role` VALUES (1,22,NULL,1);
+
diff --git a/vid-app-common/src/main/java/org/onap/vid/controllers/VidController.java b/vid-app-common/src/main/java/org/onap/vid/controllers/VidController.java
index 6d6ffb31b..3a3acd8ee 100644
--- a/vid-app-common/src/main/java/org/onap/vid/controllers/VidController.java
+++ b/vid-app-common/src/main/java/org/onap/vid/controllers/VidController.java
@@ -106,9 +106,7 @@ public class VidController extends RestrictedBaseController {
SecureServices secureServices = new SecureServices();
List<Role> roles = roleProvider.getUserRoles(request);
secureServices.setServices(aaiService.getServicesByDistributionStatus());
- //Disable roles until AAF integration finishes
- //secureServices.setReadOnly(roleProvider.userPermissionIsReadOnly(roles));
- secureServices.setReadOnly(false);
+ secureServices.setReadOnly(roleProvider.userPermissionIsReadOnly(roles));
return secureServices;
}
catch (Exception t) {
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..b268c98ce 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
@@ -51,10 +51,10 @@ public class RoleProvider {
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 {
@@ -71,7 +71,7 @@ public class RoleProvider {
LOG.error(logPrefix + " Failed to parse permission");
}
- }*/
+ }
return roleList;
}