/**
  * Register an object's clean state, e.g. after it has been reconstituted
  * from the FLOW3 persistence layer
  *
  * The method takes an optional argument $propertyName to mark only the
  * specified property as clean. This was used in conjunction with lazy
  * loading...
  *
  * @param \F3\FLOW3\AOP\JoinPointInterface $joinPoint
  * @return void
  * @before F3\FLOW3\Persistence\Aspect\DirtyMonitoringAspect->needsDirtyCheckingAspect && method(.*->FLOW3_Persistence_memorizeCleanState())
  * @author Karsten Dambekalns <*****@*****.**>
  */
 public function memorizeCleanState(\F3\FLOW3\AOP\JoinPointInterface $joinPoint)
 {
     $proxy = $joinPoint->getProxy();
     if ($joinPoint->getMethodArgument('propertyName') !== NULL) {
         $propertyNames = array($joinPoint->getMethodArgument('propertyName'));
     } else {
         $propertyNames = array_keys($this->reflectionService->getClassSchema($joinPoint->getClassName())->getProperties());
     }
     foreach ($propertyNames as $propertyName) {
         if (is_object($proxy->FLOW3_AOP_Proxy_getProperty($propertyName))) {
             $proxy->FLOW3_Persistence_cleanProperties[$propertyName] = clone $proxy->FLOW3_AOP_Proxy_getProperty($propertyName);
         } else {
             $proxy->FLOW3_Persistence_cleanProperties[$propertyName] = $proxy->FLOW3_AOP_Proxy_getProperty($propertyName);
         }
     }
 }
 /**
  * Returns the privileges a specific role has for the given joinpoint
  *
  * @param \F3\FLOW3\Security\ACL\Role $role The role for which the privileges should be returned
  * @param \F3\FLOW3\AOP\JoinPointInterface $joinPoint The joinpoint for which the privileges should be returned
  * @param string $privilegeType If set we check only for this type of privilege
  * @return array Array of privileges
  * @author Andreas Förthner <*****@*****.**>
  */
 public function getPrivilegesForJoinPoint(\F3\FLOW3\Security\ACL\Role $role, \F3\FLOW3\AOP\JoinPointInterface $joinPoint, $privilegeType = '')
 {
     $methodIdentifier = $joinPoint->getClassName() . '->' . $joinPoint->getMethodName();
     if (!isset($this->acls[$methodIdentifier])) {
         throw new \F3\FLOW3\Security\Exception\NoEntryInPolicyException('The given joinpoint was not found in the policy cache. Most likely you have to recreate the AOP proxy classes.', 1222100851);
     }
     $privileges = $this->parsePrivileges($methodIdentifier, (string) $role, $privilegeType);
     if (!is_array($privileges)) {
         return array();
     }
     return $privileges;
 }
예제 #3
0
 /**
  * Passes the signal over to the Dispatcher
  *
  * @afterreturning methodTaggedWith(signal)
  * @param F3\FLOW3\AOP\JoinPointInterface $joinPoint The current join point
  * @return void
  * @author Robert Lemke <*****@*****.**>
  */
 public function forwardSignalToDispatcher(\F3\FLOW3\AOP\JoinPointInterface $joinPoint)
 {
     $this->dispatcher->dispatch($joinPoint->getClassName(), $joinPoint->getMethodName(), $joinPoint->getMethodArguments());
 }