The case is: after logout the user has to be redirected to the page he was. But in case if the page cannot be accessed by anonymous (because of spring security intercept-url config), the user has to be redirected to another specific URL (e.g. homepage).
I can get the redirectUrl in LogoutSuccessHandler. After this I want to check whether this URL can be accessed by anonymous user. If not - redirect user to homepage.
So the question is: how can I check via java whether the specific URL can be accessed by anonymous user?