enforcePolicy() public method

Note: If we have some kind of "run as" functionality in the future, we would have to manipulate the security context before calling the policy enforcement interceptor
public enforcePolicy ( Neos\Flow\Aop\JoinPointInterface $joinPoint ) : mixed
$joinPoint Neos\Flow\Aop\JoinPointInterface The current joinpoint
return mixed The result of the target method if it has not been intercepted
コード例 #1
0
 /**
  * @test
  * @todo adjust when AfterInvocationInterceptor is used again
  */
 public function enforcePolicyDoesNotInvokeInterceptorIfAuthorizationChecksAreDisabled()
 {
     $this->mockAdviceChain->expects($this->once())->method('proceed')->with($this->mockJoinPoint);
     $this->mockJoinPoint->expects($this->once())->method('getAdviceChain')->will($this->returnValue($this->mockAdviceChain));
     $this->mockSecurityContext->expects($this->atLeastOnce())->method('areAuthorizationChecksDisabled')->will($this->returnValue(true));
     $this->mockPolicyEnforcementInterceptor->expects($this->never())->method('invoke');
     $this->policyEnforcementAspect->enforcePolicy($this->mockJoinPoint);
 }