Пример #1
0
 function render($offset = 0, $depth = 0, $sUid = false, $aGid = false)
 {
     $aNode =& $this->nodes[$offset];
     $oNode =& $aNode[0];
     $vPerm =& $aNode[1];
     if ($this->enable_acl) {
         if (!$sUid) {
             $sUid = $this->uid;
         }
         if (!$aGid) {
             $aGid = array($this->gid);
         }
         $iPerm = acl::effectiveRights($vPerm, $sUid, $aGid);
     } else {
         $iPerm = $vPerm;
     }
     if ($iPerm & SM_NODE_VISIBLE) {
         if (isset($this->p_c_rel[$offset])) {
             if (is_callable($this->renderEngine) && !($iPerm & SM_NODE_HIDE_FROM_HIERARCHY)) {
                 call_user_func_array($this->renderEngine, array($oNode, $iPerm, $depth, true, $iPerm & SM_NODE_EXPANDED));
                 ++$depth;
             }
             if ($iPerm & SM_NODE_EXPANDED) {
                 foreach ($this->p_c_rel[$offset] as $iChild) {
                     $this->render($iChild, $depth, $sUid, $aGid);
                 }
             }
         } else {
             if (is_callable($this->renderEngine) && !($iPerm & SM_NODE_HIDE_FROM_HIERARCHY)) {
                 call_user_func_array($this->renderEngine, array($oNode, $iPerm, $depth, false, false));
             }
         }
     }
 }
Пример #2
0
 /**
  * @func      checkAccess
  * @desc      calculate if provided uid/gid has sufficient rights
  * @param     arr        $aAclList     array with individual acl entries
  * @param     str        $sUid         username
  * @param     arr        $aGid         array with groups
  * @param     int        $iRights      rights to check
  * @return    bool                     sufficient rights
  * @access    public
  * @author    Marc Groot Koerkamp
  */
 function checkAccess($aAclList, $sUid = '', $aGid = array(), $iRights)
 {
     $iMyRights = acl::effectiveRights($aAclList, $sUid, $aGid);
     return acl::suffRights($iMyRights, $iRights);
 }