public int proxy(final HttpServletRequest req, final HttpServletResponse resp, final Request.MethodType methodType) throws UnauthorizedAccessException, IOException
{
String user = userManager.getRemoteUsername(req);
if (!speakeasyService.canAccessSpeakeasy(user))
{
throw new UnauthorizedAccessException(user, "Must be able to access Speakeasy to proxy requests");
}
if (!permissionManager.allowsPermission(Permission.APPLINKS_PROXY))
{
throw new UnauthorizedAccessException(user, "Permission to use Application Links proxy not enabled on this instance");
}
try
{
return doProxy(req, resp, methodType);