/**
  * Returns an array with all granted access levels for the given
  * access entity uuid
  *
  * @access public
  * @param string $accessEntityUuid
  * @return array|false
  * 
  * @throws \Zepi\Core\AccessControl\Exception Cannot load the permission for the given uuid "{uuid}".
  */
 public function getPermissionsForUuid($accessEntityUuid)
 {
     // Do not check the database if we haven't all data
     if ($accessEntityUuid == '') {
         return array();
     }
     try {
         $accessLevels = $this->getPermissionsRawForUuid($accessEntityUuid);
         $accessLevels = $this->runtimeManager->executeFilter('\\Zepi\\Core\\AccessControl\\Filter\\PermissionsBackend\\ResolvePermissions', $accessLevels);
         return $accessLevels;
     } catch (\Exception $e) {
         throw new Exception('Cannot load the permission for the given uuid "' . $accessEntityUuid . '".', 0, $e);
     }
 }
示例#2
0
文件: Framework.php 项目: zepi/turbo
 /**
  * Executes the framework. This executes the pre and post execution events.
  * Between these two events we call the correct request event. The 
  * routing table from the RouteManager returns the needed event name.
  * 
  * @access public
  */
 public function execute()
 {
     // Execute the before execution event
     $this->runtimeManager->executeEvent('\\Zepi\\Turbo\\Event\\BeforeExecution');
     // Get the event name for the request and execute the event
     $eventName = $this->routeManager->getEventNameForRoute($this->request);
     $eventName = $this->runtimeManager->executeFilter('\\Zepi\\Turbo\\Filter\\VerifyEventName', $eventName);
     if ($eventName !== false && $eventName != '') {
         $this->runtimeManager->executeEvent($eventName);
     } else {
         $this->runtimeManager->executeEvent('\\Zepi\\Turbo\\Event\\RouteNotFound');
     }
     // Execute the after execution event
     $this->runtimeManager->executeEvent('\\Zepi\\Turbo\\Event\\AfterExecution');
     // Finalize the output
     $this->runtimeManager->executeEvent('\\Zepi\\Turbo\\Event\\FinalizeOutput');
     // Execute the before output event
     $this->runtimeManager->executeEvent('\\Zepi\\Turbo\\Event\\BeforeOutput');
     // Print the output
     echo $this->response->getOutput();
     // Execute the after output event
     $this->runtimeManager->executeEvent('\\Zepi\\Turbo\\Event\\AfterOutput');
 }