diff options
author | Ittay Stern <ittay.stern@att.com> | 2020-01-28 12:36:50 +0200 |
---|---|---|
committer | Ittay Stern <ittay.stern@att.com> | 2020-01-28 12:42:49 +0200 |
commit | 22fb6d661b72bcb99e467c2289257d360d5e13a9 (patch) | |
tree | a7d0508b4db00125de4057bb1cac2caf5ab564e4 /vid-app-common/src/main/java | |
parent | abb69004c16707e1dafa7a75050e8c026de9fe31 (diff) |
Rename Role's subscriberId field
It was named subscriberName, although containing the id.
Issue-ID: VID-758
Change-Id: I28fd174a6eab642d34aef207e9d3ca69e8091884
Signed-off-by: Ittay Stern <ittay.stern@att.com>
Diffstat (limited to 'vid-app-common/src/main/java')
6 files changed, 22 insertions, 22 deletions
diff --git a/vid-app-common/src/main/java/org/onap/vid/roles/AlwaysValidRoleValidator.java b/vid-app-common/src/main/java/org/onap/vid/roles/AlwaysValidRoleValidator.java index e12f5403f..66eab1810 100644 --- a/vid-app-common/src/main/java/org/onap/vid/roles/AlwaysValidRoleValidator.java +++ b/vid-app-common/src/main/java/org/onap/vid/roles/AlwaysValidRoleValidator.java @@ -27,7 +27,7 @@ public class AlwaysValidRoleValidator implements RoleValidator { } @Override - public boolean isSubscriberPermitted(String subscriberName) { + public boolean isSubscriberPermitted(String subscriberId) { return true; } @@ -37,7 +37,7 @@ public class AlwaysValidRoleValidator implements RoleValidator { } @Override - public boolean isTenantPermitted(String globalCustomerId, String serviceType, String tenantName) { + public boolean isTenantPermitted(String subscriberId, String serviceType, String tenantName) { return true; } } diff --git a/vid-app-common/src/main/java/org/onap/vid/roles/Role.java b/vid-app-common/src/main/java/org/onap/vid/roles/Role.java index 454483031..3d94dc00a 100644 --- a/vid-app-common/src/main/java/org/onap/vid/roles/Role.java +++ b/vid-app-common/src/main/java/org/onap/vid/roles/Role.java @@ -28,15 +28,15 @@ public class Role { private EcompRole ecompRole; - private String subscribeName; + private String subscriberId; private String serviceType; private String tenant; - public Role(EcompRole ecompRole, String subscribeName, String serviceType, String tenant) { + public Role(EcompRole ecompRole, String subscriberId, String serviceType, String tenant) { this.ecompRole = ecompRole; - this.subscribeName = subscribeName; + this.subscriberId = subscriberId; this.serviceType = serviceType; this.tenant = tenant; } @@ -46,12 +46,12 @@ public class Role { } - public String getSubscribeName() { - return subscribeName; + public String getSubscriberId() { + return subscriberId; } - public void setSubscribeName(String subscribeName) { - this.subscribeName = subscribeName; + public void setSubscriberId(String subscriberId) { + this.subscriberId = subscriberId; } public String getServiceType() { 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 4ad168c4f..ed280c8b8 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 @@ -38,9 +38,9 @@ public interface RoleValidator { : new RoleValidatorBySubscriberAndServiceType(roles); } - boolean isSubscriberPermitted(String subscriberName); + boolean isSubscriberPermitted(String subscriberId); boolean isServicePermitted(WithPermissionProperties serviceInstanceSearchResult); - boolean isTenantPermitted(String globalCustomerId, String serviceType, String tenantName); + boolean isTenantPermitted(String subscriberId, String serviceType, String tenantName); } diff --git a/vid-app-common/src/main/java/org/onap/vid/roles/RoleValidatorByOwningEntity.java b/vid-app-common/src/main/java/org/onap/vid/roles/RoleValidatorByOwningEntity.java index 726567cc6..50fc1091e 100644 --- a/vid-app-common/src/main/java/org/onap/vid/roles/RoleValidatorByOwningEntity.java +++ b/vid-app-common/src/main/java/org/onap/vid/roles/RoleValidatorByOwningEntity.java @@ -28,7 +28,7 @@ public class RoleValidatorByOwningEntity implements RoleValidator{ } @Override - public boolean isSubscriberPermitted(String subscriberName) { + public boolean isSubscriberPermitted(String subscriberId) { return false; } @@ -38,7 +38,7 @@ public class RoleValidatorByOwningEntity implements RoleValidator{ } @Override - public boolean isTenantPermitted(String globalCustomerId, String serviceType, String tenantName) { + public boolean isTenantPermitted(String subscriberId, String serviceType, String tenantName) { return false; } } diff --git a/vid-app-common/src/main/java/org/onap/vid/roles/RoleValidatorBySubscriberAndServiceType.java b/vid-app-common/src/main/java/org/onap/vid/roles/RoleValidatorBySubscriberAndServiceType.java index 95d8a1627..1e0f9f461 100644 --- a/vid-app-common/src/main/java/org/onap/vid/roles/RoleValidatorBySubscriberAndServiceType.java +++ b/vid-app-common/src/main/java/org/onap/vid/roles/RoleValidatorBySubscriberAndServiceType.java @@ -31,9 +31,9 @@ public class RoleValidatorBySubscriberAndServiceType implements RoleValidator { } @Override - public boolean isSubscriberPermitted(String subscriberName) { + public boolean isSubscriberPermitted(String subscriberId) { for (Role role : userRoles) { - if (role.getSubscribeName().equals(subscriberName)) { + if (role.getSubscriberId().equals(subscriberId)) { return true; } } @@ -43,7 +43,7 @@ public class RoleValidatorBySubscriberAndServiceType implements RoleValidator { @Override public boolean isServicePermitted(WithPermissionProperties permissionProperties) { for (Role role : userRoles) { - if (role.getSubscribeName().equals(permissionProperties.getSubscriberId()) && role.getServiceType().equals(permissionProperties.getServiceType())) { + if (role.getSubscriberId().equals(permissionProperties.getSubscriberId()) && role.getServiceType().equals(permissionProperties.getServiceType())) { return true; } } @@ -51,9 +51,9 @@ public class RoleValidatorBySubscriberAndServiceType implements RoleValidator { } @Override - public boolean isTenantPermitted(String globalCustomerId, String serviceType, String tenantName) { + public boolean isTenantPermitted(String subscriberId, String serviceType, String tenantName) { for (Role role : userRoles) { - if (role.getSubscribeName().equals(globalCustomerId) + if (role.getSubscriberId().equals(subscriberId) && role.getServiceType().equals(serviceType) && (role.getTenant() == null || role.getTenant().equalsIgnoreCase(tenantName))) { return true; diff --git a/vid-app-common/src/main/java/org/onap/vid/roles/RoleValidatorsComposer.kt b/vid-app-common/src/main/java/org/onap/vid/roles/RoleValidatorsComposer.kt index 873622389..d012cb3f3 100644 --- a/vid-app-common/src/main/java/org/onap/vid/roles/RoleValidatorsComposer.kt +++ b/vid-app-common/src/main/java/org/onap/vid/roles/RoleValidatorsComposer.kt @@ -7,10 +7,10 @@ class RoleValidatorsComposer(private vararg val roleValidators: RoleValidator) : override fun isServicePermitted(p: WithPermissionProperties): Boolean = roleValidators.any { it.isServicePermitted(p) } - override fun isSubscriberPermitted(subscriberName: String?): Boolean = - roleValidators.any { it.isSubscriberPermitted(subscriberName) } + override fun isSubscriberPermitted(subscriberId: String?): Boolean = + roleValidators.any { it.isSubscriberPermitted(subscriberId) } - override fun isTenantPermitted(globalCustomerId: String?, serviceType: String?, tenantName: String?): Boolean = - roleValidators.any { it.isTenantPermitted(globalCustomerId, serviceType, tenantName) } + override fun isTenantPermitted(subscriberId: String?, serviceType: String?, tenantName: String?): Boolean = + roleValidators.any { it.isTenantPermitted(subscriberId, serviceType, tenantName) } } |