diff options
author | Ofir Sonsino <os0695@att.com> | 2018-02-20 18:03:30 +0200 |
---|---|---|
committer | Ofir Sonsino <os0695@intl.att.com> | 2018-02-27 14:47:52 +0200 |
commit | efedea1c5d80532f5b1180d57c8dafce5dcb302a (patch) | |
tree | c4bdefe8758b01f31c9e91a9ded0ab989daeb5e2 /vid-app-common/src/main/java/org/onap/vid/roles/RoleValidator.java | |
parent | b94bd70f1595fad9546c3506393613f68504f495 (diff) |
org.onap migration
Change-Id: I5e2d01a6da21d4003c910b5fe0702b35c2089a77
Issue-ID: VID-86
Signed-off-by: Ofir Sonsino <os0695@intl.att.com>
Diffstat (limited to 'vid-app-common/src/main/java/org/onap/vid/roles/RoleValidator.java')
-rw-r--r-- | vid-app-common/src/main/java/org/onap/vid/roles/RoleValidator.java | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/vid-app-common/src/main/java/org/onap/vid/roles/RoleValidator.java b/vid-app-common/src/main/java/org/onap/vid/roles/RoleValidator.java index f4f17fac..7486eba9 100644 --- a/vid-app-common/src/main/java/org/onap/vid/roles/RoleValidator.java +++ b/vid-app-common/src/main/java/org/onap/vid/roles/RoleValidator.java @@ -10,6 +10,7 @@ import java.util.Map; */ public class RoleValidator { + private boolean disableRoles = true; private List<Role> userRoles; public RoleValidator(List<Role> roles) { @@ -17,6 +18,8 @@ public class RoleValidator { } public boolean isSubscriberPermitted(String subscriberName) { + if(this.disableRoles) return true; + for (Role role : userRoles) { if (role.getSubscribeName().equals(subscriberName)) return true; @@ -25,6 +28,8 @@ public class RoleValidator { } public boolean isServicePermitted(String subscriberName, String serviceType) { + if(this.disableRoles) return true; + for (Role role : userRoles) { if (role.getSubscribeName().equals(subscriberName) && role.getServiceType().equals(serviceType)) return true; @@ -33,6 +38,8 @@ public class RoleValidator { } public boolean isMsoRequestValid(RequestDetails mso_request) { + if(this.disableRoles) return true; + try { String globalSubscriberIdRequested = (String) ((Map) ((Map) mso_request.getAdditionalProperties().get("requestDetails")).get("subscriberInfo")).get("globalSubscriberId"); String serviceType = (String) ((Map) ((Map) mso_request.getAdditionalProperties().get("requestDetails")).get("requestParameters")).get("subscriptionServiceType"); @@ -45,6 +52,8 @@ public class RoleValidator { } public boolean isTenantPermitted(String globalCustomerId, String serviceType, String tenantName) { + if(this.disableRoles) return true; + for (Role role : userRoles) { if (role.getSubscribeName().equals(globalCustomerId) && role.getServiceType().equals(serviceType) |