diff options
Diffstat (limited to 'catalog-be/src/main/java/org')
-rw-r--r-- | catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/BaseBusinessLogic.java | 2 | ||||
-rw-r--r-- | catalog-be/src/main/java/org/openecomp/sdc/be/components/validation/UserValidations.java | 4 |
2 files changed, 5 insertions, 1 deletions
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/BaseBusinessLogic.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/BaseBusinessLogic.java index 8b18346bdd..de0f791eda 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/BaseBusinessLogic.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/BaseBusinessLogic.java @@ -375,7 +375,7 @@ public abstract class BaseBusinessLogic { } // verify component last update user is the current user String lastUpdaterUserId = component.getLastUpdaterUserId(); - if (!userId.equals(lastUpdaterUserId)) { + if (!userValidations.isSameUser(userId, lastUpdaterUserId)) { log.debug("Current user is not last updater, last updater userId: {}, current user userId: {}", lastUpdaterUserId, userId); throw new ByActionStatusComponentException(actionStatus); } diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/validation/UserValidations.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/validation/UserValidations.java index cf4f84884f..3d148f64c1 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/components/validation/UserValidations.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/validation/UserValidations.java @@ -82,4 +82,8 @@ public class UserValidations { public User validateUserExists(final User user) { return validateUserExists(user.getUserId()); } + + public boolean isSameUser(final String userId1, final String userId2) { + return validateUserExists(userId1).getUserId().equals(validateUserExists(userId2).getUserId()); + } } |