Commit 58bc0f8c authored by Ivan Tyagov's avatar Ivan Tyagov

Fix an use case of a renderjs site under the context of an anonymous user.

What happens is that in same script (line 907) we want to calculateHateos for
restricted case without passing (I consider explict decision) the response.
What happens is that script will try to redirect to login form using non existing
response parameter. So fix is redirect ONLY if we do pass response.
This allows a Web Site to work with Anonymous accessible content.

@romain  and / or @rporchetto  please feel free to contact me so I show my use case with a real example.

/reviewed-on nexedi/erp5!905
parent cee66752
......@@ -1167,7 +1167,7 @@ def calculateHateoas(is_portal=None, is_site_root=None, traversed_document=None,
relative_url=None, restricted=None, list_method=None,
default_param_json=None, form_relative_url=None, extra_param_json=None):
if (restricted == 1) and (portal.portal_membership.isAnonymousUser()):
if (restricted == 1) and (portal.portal_membership.isAnonymousUser() and (response is not None)):
login_relative_url = site_root.getLayoutProperty("configuration_login", default="")
if (login_relative_url):
response.setHeader(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment