mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-11 07:55:47 +01:00
Change correct filter for security
This commit is contained in:
@@ -84,7 +84,7 @@ public class SecurityFilter extends HttpFilter
|
|||||||
HttpServletResponse response, FilterChain chain)
|
HttpServletResponse response, FilterChain chain)
|
||||||
throws IOException, ServletException
|
throws IOException, ServletException
|
||||||
{
|
{
|
||||||
if (!SecurityRequests.isAuthenticationRequest(request))
|
if (!SecurityRequests.isAuthenticationRequest(request) && !SecurityRequests.isIndexRequest(request))
|
||||||
{
|
{
|
||||||
Subject subject = SecurityUtils.getSubject();
|
Subject subject = SecurityUtils.getSubject();
|
||||||
if (hasPermission(subject))
|
if (hasPermission(subject))
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ public final class SecurityRequests {
|
|||||||
|
|
||||||
public static boolean isIndexRequest(HttpServletRequest request) {
|
public static boolean isIndexRequest(HttpServletRequest request) {
|
||||||
String uri = request.getRequestURI().substring(request.getContextPath().length());
|
String uri = request.getRequestURI().substring(request.getContextPath().length());
|
||||||
return isAuthenticationRequest(uri);
|
return isIndexRequest(uri);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isIndexRequest(String uri) {
|
public static boolean isIndexRequest(String uri) {
|
||||||
|
|||||||
@@ -99,7 +99,7 @@ public class ApiAuthenticationFilter extends AuthenticationFilter
|
|||||||
throws IOException, ServletException
|
throws IOException, ServletException
|
||||||
{
|
{
|
||||||
// skip filter on login resource
|
// skip filter on login resource
|
||||||
if (SecurityRequests.isAuthenticationRequest(request) || SecurityRequests.isIndexRequest(request))
|
if (SecurityRequests.isAuthenticationRequest(request) )
|
||||||
{
|
{
|
||||||
chain.doFilter(request, response);
|
chain.doFilter(request, response);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user