summaryrefslogtreecommitdiffstats
path: root/catalog-be/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'catalog-be/src/main')
-rw-r--r--catalog-be/src/main/java/org/openecomp/sdc/be/components/validation/AccessValidations.java26
-rw-r--r--catalog-be/src/main/java/org/openecomp/sdc/be/info/ArtifactAccessInfo.java4
2 files changed, 15 insertions, 15 deletions
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/validation/AccessValidations.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/validation/AccessValidations.java
index 335a9398d7..28723f6c29 100644
--- a/catalog-be/src/main/java/org/openecomp/sdc/be/components/validation/AccessValidations.java
+++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/validation/AccessValidations.java
@@ -14,7 +14,6 @@ public class AccessValidations {
private final UserValidations userValidations;
private final ComponentValidations componentValidations;
-
public AccessValidations(UserValidations userValidations, ComponentValidations componentValidations) {
this.userValidations = userValidations;
this.componentValidations = componentValidations;
@@ -31,8 +30,16 @@ public class AccessValidations {
validateUserIsAdminOrDesigner(user);
return componentValidations.validateComponentIsCheckedOutByUser(componentId, componentType, userId);
}
- private User retrieveUser(String userId, String actionContext) {
- return userValidations.validateUserExists(userId, actionContext, true);
+
+
+ public void validateUserCanWorkOnComponent(Component component, String userId, String actionContext) {
+ User user = retrieveUser(userId, actionContext);
+ validateUserIsAdminOrDesigner(user);
+ componentValidations.validateComponentIsCheckedOutByUser(component, userId);
+ }
+
+ public void validateUserExists(String userId, String context) {
+ retrieveUser(userId, context);
}
public void validateUserExist(String userId, String actionContext) {
@@ -45,6 +52,10 @@ public class AccessValidations {
return user;
}
+ private User retrieveUser(String userId, String actionContext) {
+ return userValidations.validateUserExists(userId, actionContext, true);
+ }
+
private void validateUserIsAdminOrDesigner(User user) {
List<Role> roles = new ArrayList<>(2);
roles.add(Role.ADMIN);
@@ -52,13 +63,4 @@ public class AccessValidations {
userValidations.validateUserRole(user, roles);
}
- public void validateUserCanWorkOnComponent(Component component, String userId, String actionContext) {
- User user = retrieveUser(userId, actionContext);
- validateUserIsAdminOrDesigner(user);
- componentValidations.validateComponentIsCheckedOutByUser(component, userId);
- }
-
- public void validateUserExists(String userId, String context) {
- retrieveUser(userId, context);
- }
}
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/info/ArtifactAccessInfo.java b/catalog-be/src/main/java/org/openecomp/sdc/be/info/ArtifactAccessInfo.java
index bedbff46b1..490684e20d 100644
--- a/catalog-be/src/main/java/org/openecomp/sdc/be/info/ArtifactAccessInfo.java
+++ b/catalog-be/src/main/java/org/openecomp/sdc/be/info/ArtifactAccessInfo.java
@@ -35,10 +35,8 @@ public class ArtifactAccessInfo {
urlBuilder = urlBuilder.append(servletContext).append("/");
urlBuilder.append("resources/")
// .append(artifactData.getResourceId()).append("/")
-
- .append("/artifacts/");
+ .append("artifacts/");
this.url = urlBuilder.toString();
-
}
private String name;