-
-
Notifications
You must be signed in to change notification settings - Fork 224
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
9.0 Discussion Node property mapping in controllers #4873
Comments
Copied from #4734 (comment)
|
|
In the previous weekly (9.2.) we discussed (bastian, christian, denny, me) that we DO NOT want to support Instead to still make it simpler to get a node in a controller we decided that we want to introduce a fully qualified Similarly as bastian put it here #4564 (comment), the introduction of the NodeIdentity with the overhauled routing we can allow patterns like these: public function someAction(string $nodeIdentity): {
$nodeIdentity = NodeIdentity::fromJsonString($nodeIdentity);
// ...
}
// with little property converter, almost no gain
public function someAction(NodeIdentity $nodeIdentity): {
$node = $this->someService->findNodeByIdentity($nodeIdentity);
} |
Actually today when christian Bastian and me were discussing #5072 we came to revisit our decision here. While sometimes thinking that we know whats better for the user we should not go to far. This might be such case. That means we will still support property mapping Nodes and auto converting them from their fully qualified json serialised NodeAddress. Though we might call that deprecated and suggest better alternatives. Initially i was very much against this node property mapper because of the mentioned hack that we access the bootstrap's active request handler. But with introduction that the node address also contains its content repository this will not a problem anymore and the parameter will contain everything the property mapper needs to know. |
But how to we want to actually determine the correct visibility for the subgraph? $subgraph = $contentRepository->getContentGraph($nodeAddress->workspaceName)->getSubgraph(
$nodeAddress->dimensionSpacePoint,
$nodeAddress->workspaceName->isLive()
? VisibilityConstraints::frontend()
: VisibilityConstraints::withoutRestrictions()
); but if i remember correctly this will be solved with bastians cr privileges? |
Resolved via #5068 |
…kspaceName` in policy for workspaces `current.userInformation.personalWorkspaceName` (`UserService::getPersonalWorkspaceName()`) was initially removed in c3f51e2 because with multiple content repositories we cannot find out the value: ```php public function getPersonalWorkspaceName(): ?string { $currentUser = $this->userDomainService->getCurrentUser(); $cr = 'default'; // TODO!!! $this->workspaceService->getPersonalWorkspaceForUser($cr, $currentUser); return $workspace->workspaceName->value; } ``` This is luckily no longer needed as the now called `NodeAddressToNodeConverter` (which we decided to keep in Neos 9.0: neos#4873) Will handle this itself through the security in `ContentRepository::getContentSubgraph()` via neos#5298 Additionally, this pr makes `UserService::getPersonalWorkspaceName()` throw and exception to ease upgrading as otherwise `NULL` will be evaluated.
…kspaceName` in policy for workspaces `current.userInformation.personalWorkspaceName` (`UserService::getPersonalWorkspaceName()`) was initially removed in c3f51e2 because with multiple content repositories we cannot find out the value: ```php public function getPersonalWorkspaceName(): ?string { $currentUser = $this->userDomainService->getCurrentUser(); $cr = 'default'; // TODO!!! $this->workspaceService->getPersonalWorkspaceForUser($cr, $currentUser); return $workspace->workspaceName->value; } ``` This is luckily no longer needed as the now called `NodeAddressToNodeConverter` (which we decided to keep in Neos 9.0: neos#4873) Will handle this itself through the security in `ContentRepository::getContentSubgraph()` via neos#5298 Additionally, this pr makes `UserService::getPersonalWorkspaceName()` throw and exception to ease upgrading as otherwise `NULL` will be evaluated.
in neos 8 one could leverage the property mapping to write a controller like this
and pass as node its fully qualified serialised representation: the old context path
?node=/sites/neosdemo/features/multiple-columns@user-admin;language=en_US
.In Neos 9 this is not that easily doable as the NodeAdress (the closest to its old context path) is not fully qualified see #4564. The correct way would be:
But due to a hack in the NewNodeConverter - accessing the bootstraps
getActiveRequestHandler
- we can make that magically work:When i stumbled upon the
NewNodeConverter
, based on its comment, i assumed that its only used for fusion uncached serialisation. Thats why i opened this issue #4732 (and pr #4734) to remove fusion dependency to the node property mapper and the hack.But it seems i only thought, being initially unaware of the hack, that the old property mapping style would and should not work. By the fact that we dont use it i was even more convinced. It seems there was until now no real discussion and decision?.
The text was updated successfully, but these errors were encountered: