neos / redirecthandler

The Neos.RedirectHandler package for Flow
MIT License
4 stars 15 forks source link

FEATURE: Allow redirect in case of hidden node #40

Closed gjwnc closed 4 years ago

gjwnc commented 4 years ago

This is a fix for issue #39, but to be honest I'm not sure it's a good one because of my lack of knowledge on neos internals.

This PR basically converts the a node path available by matchResults into a node. If the node is available - e.g. not hidden - the redirect will be not be used. If the node is not available the redirect handling is done.

My concerns with this are:

  1. I don't know why I need the withoutAuthorizationChecks call. The NodeConverter itself has the securityContext injected, but doesn't use it. So the need for withoutAuthorizationChecks might be due to some sideeffect where the security context is not yet initalized when the redirect handler is running?
  2. Since I'm using NodeInterface and NodeConverter, these changes tightly couple the redirecthandler to the ContentRepository. So, I'm not sure if I need to change composer.json or what to add there?
  3. I'm not sure if it's ok to directly use NodeConverter->convertFrom() without some kind of PropertyMapper. It works, but I'm not sure if it is kind of good practice?
jonnitto commented 4 years ago

Does this work if a frontend user is logged in and he tries to access a restricted page?

Sebobo commented 4 years ago

I close this as we need a different solution in the NeosAdapter package.