Using current.securityContext Policies.yaml entities section triggers Parser Error
If you use some Content Security Rule like:
DigiComp_Fairdrive_ForeignDispositions: this.createdfrom != current.securityContext.party
FLOW3 will crash completely with:
: Parse error: syntax error, unexpected $end in [...]FLOW3/Data/Temporary/Development/Cache/Code/FLOW3_Object_Classes/TYPO3_FLOW3_Security_Aspect_PersistenceQueryRewritingAspect_Original.php(374) : eval()'d code
Updated by Christopher Hlubek over 9 years ago
Moving over the test discussion here:
We already have functional tests for persistence with entities and repositories in the
TYPO3\FLOW3\Tests\Functional\Persistence\Fixtures namespace. Also the Configuration in
TYPO3.FLOW3/Configuration/Testing/Policy.yaml could be used for testing (with some comment about the usage).
I think a functional test for content security would best go into a new testcase
TYPO3\FLOW3\Tests\Functional\Security\ContentSecurityTest. Take a look at the
MethodSecurityTest for a hint about how to authorize different roles in a functional test.
To run a functional test you have to use the
FunctionalTests.xml PHPUnit configuration in
Build/Common/PhpUnit. For example in the FLOW3 package directory you can call
phpunit -c ../../../Build/Common/PhpUnit/FunctionalTests.xml Tests/Functional to run the functional tests.
The test should first cause the error (without your change) and then pass after your fix.