Class CanUseFilter
- java.lang.Object
-
- com.atlassian.core.filters.AbstractHttpFilter
-
- com.atlassian.confluence.plugins.rest.filter.CanUseFilter
-
- All Implemented Interfaces:
javax.servlet.Filter
- Direct Known Subclasses:
CanUseWithAnyConfluenceAccessFilter
public class CanUseFilter extends com.atlassian.core.filters.AbstractHttpFilter
A filter which checks if the current user is permitted to use Confluence. If the request comes from the anonymous user and they are not permitted then a 401 error will be returned. If the request comes from an authenticated user and they are not permitted then a 403 error will be returned. This difference allows a client to perhaps offer an authentication mechanism to the anonymous user before a retry. If the request is permitted then this filter does nothing.Note: This will only allow users with licensed access to Confluence, or anonymous users if anonymous access is enabled globally. To also allow users with authenticated visitor access, use
CanUseWithAnyConfluenceAccessFilter
instead.
-
-
Constructor Summary
Constructors Constructor Description CanUseFilter(PermissionManager permissionManager)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
canUseConfluenceCheck(com.atlassian.user.User remoteUser)
protected void
doFilter(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, javax.servlet.FilterChain filterChain)
-
-
-
Constructor Detail
-
CanUseFilter
public CanUseFilter(PermissionManager permissionManager)
-
-
Method Detail
-
doFilter
protected void doFilter(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, javax.servlet.FilterChain filterChain) throws IOException, javax.servlet.ServletException
- Specified by:
doFilter
in classcom.atlassian.core.filters.AbstractHttpFilter
- Throws:
IOException
javax.servlet.ServletException
-
canUseConfluenceCheck
protected boolean canUseConfluenceCheck(com.atlassian.user.User remoteUser)
-
-