public function getPaths($selected) { $paths = parent::getPaths($selected); $managedfileCache = $this->getManagedfilesFromCache(); foreach ($paths as &$path) { foreach ($path['files'] as $delta => $file) { $vp = $file['Path']; // this is a virtual path $pp = self::virtualToPublic($vp); if ($file['IsFolder']) { $pp .= DIRECTORY_SEPARATOR; } // check whether this entity is managed and show based on read permission. $mf = $managedfileCache[$pp]; $path['files'][$delta]['IsManaged'] = null !== $mf; if ($mf) { if ($mf->isReadable()) { $path['files'][$delta]['ManagedPerm'] = $mf->isWritable() ? 'w' : 'r'; } else { // do not show this entity if logged in user does not have read permission. unset($path['files'][$delta]); } } //trace($path['files'][$delta]); //MARK } } return $paths; }