class AfterInvocation implements InterceptorInterface (View source)

This is the second main security interceptor, which enforces the current security policy for return values and is usually applied over AOP:

  1. We call the AfterInvocationManager with the method's return value as parameter
  2. If we had a "run as" support, we would have to reset the security context
  3. If a PermissionDeniedException was thrown we look for any an authentication entry point in the active tokens to redirect to authentication
  4. Then the value is returned to the caller

Properties

protected AfterInvocationManagerInterface $afterInvocationManager
protected mixed $result

Result of the (probably intercepted) target method

Methods

__construct(Context $securityContext, AfterInvocationManagerInterface $afterInvocationManager)

Constructor.

void
setJoinPoint(JoinPointInterface $joinPoint)

Sets the current joinpoint for this interception

void
setResult(mixed $result)

Sets the result (return object) of the intercepted method

bool
invoke()

Invokes the security interception

Details

__construct(Context $securityContext, AfterInvocationManagerInterface $afterInvocationManager)

Constructor.

Parameters

Context $securityContext

The current security context

AfterInvocationManagerInterface $afterInvocationManager

The after invocation manager

void setJoinPoint(JoinPointInterface $joinPoint)

Sets the current joinpoint for this interception

Parameters

JoinPointInterface $joinPoint

The current joinpoint

Return Value

void

void setResult(mixed $result)

Sets the result (return object) of the intercepted method

Parameters

mixed $result

The result of the intercepted method

Return Value

void

bool invoke()

Invokes the security interception

Implement interception logic

Return Value

bool

true if the security checks was passed