summaryrefslogtreecommitdiffstats
path: root/openecomp-be/api
diff options
context:
space:
mode:
Diffstat (limited to 'openecomp-be/api')
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/src/main/java/org/openecomp/server/filters/ActionAuthorizationFilter.java35
1 files changed, 13 insertions, 22 deletions
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/src/main/java/org/openecomp/server/filters/ActionAuthorizationFilter.java b/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/src/main/java/org/openecomp/server/filters/ActionAuthorizationFilter.java
index f54b06d46a..181f7add88 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/src/main/java/org/openecomp/server/filters/ActionAuthorizationFilter.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/src/main/java/org/openecomp/server/filters/ActionAuthorizationFilter.java
@@ -1,21 +1,17 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
+/*
+ * Copyright © 2016-2017 European Support Limited
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ============LICENSE_END=========================================================
*/
package org.openecomp.server.filters;
@@ -32,29 +28,24 @@ import java.io.IOException;
public class ActionAuthorizationFilter implements Filter {
- private boolean runningOnLocal = true;
@Override
public void destroy() {
- // TODO Auto-generated method stub
+ //destroy() is not implemented for ActionAuthorizationFilter
}
@Override
- public void doFilter(ServletRequest arg0, ServletResponse arg1, FilterChain arg2)
+ public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse,
+ FilterChain filterChain)
throws IOException, ServletException {
- if (runningOnLocal) {
- HttpServletRequest httpRequest = (HttpServletRequest) arg0;
- if (httpRequest.isUserInRole(httpRequest.getMethod().toUpperCase())) {
- arg2.doFilter(arg0, arg1);
- } else {
- setResponseStatus((HttpServletResponse) arg1, HttpServletResponse.SC_FORBIDDEN);
- }
+ HttpServletRequest httpRequest = (HttpServletRequest) servletRequest;
+ if (httpRequest.isUserInRole(httpRequest.getMethod().toUpperCase())) {
+ filterChain.doFilter(servletRequest, servletResponse);
} else {
- //call super doFilter of cadi authorization filter with relavant info as and when available
+ setResponseStatus((HttpServletResponse) servletResponse, HttpServletResponse.SC_FORBIDDEN);
}
-
}
private void setResponseStatus(HttpServletResponse response, int status) {
@@ -63,7 +54,7 @@ public class ActionAuthorizationFilter implements Filter {
@Override
public void init(FilterConfig arg0) throws ServletException {
-
+ //init() is not implemented for ActionAuthorizationFilter
}
}