Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong fe_groups in field "access" of the solr core, when indexing with solrfal #166

Open
haraldwitt opened this issue Jul 7, 2021 · 0 comments

Comments

@haraldwitt
Copy link
Contributor

Example / Description:
Set any group at the root of a private storage. All files indexed with solrfal will get this group in the core field "access". So a user might get shown more search results as he should see. Clicking on some of the result-links will result in "No access" message of fal_securedownload. Furtermore the user could see secret informations in the prview of the search result.

Reason:
\BeechIt\FalSecuredownload\Aspects\SolrFalAspect::class contains the folloing line:

$resourcePermissions = $this->checkPermissionsService->getPermissions($item->getFile());

In getPermissions is the following loop:

foreach ($this->getFolderRootLine($resource->getParentFolder()) as $folder)

The array contains the rootline from the root of the storage down to the ressource.
But it should be examined in the reverse order. This is because "The deeper the folder structure, the more restrictive the permissions". And the most restrictive permission from the view of the ressource should match.
So an arry_reverse() would help.
This should be sure because the method is only called from:

  • Aspects/SolrFalAspect.php line 52
  • Hooks/KeSearchFilesHook.php lines 77 and 102

But there is another method, also calling getFolderRootLine().

checkFolderRootLineAccess(Folder $folder, $userFeGroups)

Here it could be wrong too because it also makes a break at the first match. Not checked it till now!
In case it's also wrong it would surely be better to remove the array_reverse() at the return statement of getFolderRootLine()?

This issue should also solve issue #161

FamousWolf pushed a commit that referenced this issue Sep 20, 2023
* Update CheckPermissions.php

     * Get FeGroups that are allowed to view a file/folder (checks NOT full rootline)
     * Check from the given folder up to root, i. e. the reverse! rootline. 
     * First restriction matches.
     * 
     * This Bugfix should be sure because it's only called from:
     *   - Aspects/SolrFalAspect.php
     *   - Hooks/KeSearchFilesHook.php
     *
     * This Bugfix resolvees issues:
     *   - #161
     *   - #166
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant