/**
  * Get nested menu elements depending on user rights.
  *
  * @param Perspective $menuElement from the structure.xml
  * @return array menu elements list
  */
 private function getMenuElementChildren(Perspective $menuElement)
 {
     $children = array();
     foreach ($menuElement->getChildren() as $section) {
         if (tao_models_classes_accessControl_AclProxy::hasAccess($section->getAction(), $section->getController(), $section->getExtensionId())) {
             $children[] = $section;
         }
     }
     return $children;
 }
Example #2
0
 /**
  * Get nested menu elements depending on user rights.
  *
  * @param Perspective $menuElement from the structure.xml
  * @return array menu elements list
  */
 private function getMenuElementChildren(Perspective $menuElement)
 {
     $user = common_Session_SessionManager::getSession()->getUser();
     $children = array();
     foreach ($menuElement->getChildren() as $section) {
         $resolver = new ActionResolver($section->getUrl());
         if (FuncProxy::accessPossible($user, $resolver->getController(), $resolver->getAction())) {
             $children[] = $section;
         }
     }
     return $children;
 }
Example #3
0
 /**
  * Get nested menu elements depending on user rights.
  *
  * @param Perspective $menuElement from the structure.xml
  * @return array menu elements list
  */
 private function getMenuElementChildren(Perspective $menuElement)
 {
     $user = common_Session_SessionManager::getSession()->getUser();
     $children = array();
     foreach ($menuElement->getChildren() as $section) {
         try {
             $resolver = new ActionResolver($section->getUrl());
             if (FuncProxy::accessPossible($user, $resolver->getController(), $resolver->getAction())) {
                 $children[] = $section;
             }
         } catch (ResolverException $e) {
             common_Logger::w('Invalid reference in structures: ' . $e->getMessage());
         }
     }
     return $children;
 }