roundcubemail/program/lib/Roundcube/rcube_imap.php
protected function filter_rights($a_folders, $rights)
    {
        $regex = '/('.$rights.')/';

        foreach ($a_folders as $idx => $folder) {
            if ($this->folder_namespace($folder) == 'personal') {
                continue;
            }

            $myrights = join('', (array)$this->my_rights($folder));

            if ($myrights !== null && !preg_match($regex, $myrights)) {
                unset($a_folders[$idx]);
            }
        }

        return $a_folders;
    }
protected function filter_rights($a_folders, $rights)
    {
        $regex = '/('.$rights.')/';

        foreach ($a_folders as $idx => $folder) {
            if ($this->folder_namespace($folder) == 'personal') {
                continue;
            }

            $myrights = join('', (array)$this->my_rights($folder));

            if ($myrights !== null && !preg_match($regex, $myrights)) {
                unset($a_folders[$idx]);
            }
        }

        return $a_folders;
    }
protected function filter_rights ( $ a_folders , $ rights ) { $ regex = '/(' . $ rights . ')/' ; foreach ( $ a_folders as $ idx => $ folder ) { if ( $ this -> folder_namespace ( $ folder ) == 'personal' ) { continue ; } $ myrights = join ( '' , ( array ) $ this -> my_rights ( $ folder ) ) ; if ( $ myrights !== null && ! preg_match ( $ regex , $ myrights ) ) { unset ( $ a_folders [ $ idx ] ) ; } } return $ a_folders ; }
Filter the given list of folders according to access rights

For performance reasons we assume user has full rights
on all personal folders.
Filter the given list of folders according to access rights