public static function recBuildRealmTree($data, $node, $details, $guid, $group)
 {
     if ($group === true) {
         $details['groupallow'] = AuthUtil::getGroupAccess($node[0], $guid);
     } elseif ($group === false) {
         $details['userallow'] = AuthUtil::getUserAccess($node[0], $guid);
         $details['groupallow'] = AuthUtil::getGroupAccessForUser($node[0], $guid);
     }
     $tree = array('_DETAILS_' => $details);
     foreach ($data as $row) {
         if ($row['parentid'] == $node[0]) {
             $tree[$row['name']] = $row['name'];
             $tmp = $node;
             array_unshift($tmp, $row['realmid']);
             $tree[$row['name']] = AuthUtil::recBuildrealmTree($data, $tmp, $row, $guid, $group);
         }
     }
     return $tree;
 }