-
Notifications
You must be signed in to change notification settings - Fork 64
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
solrfal indexing and fe-groups restriction not working #161
Comments
This seems related: #134 - but I think it is not sufficient. |
I got the same Problem. If a folder has no access restrictions the result for $feGroups after the run over all folders is an empty array. But this will always result in empty '[]' cause there are no groups from folders run. With this solution the folder rights are respected but if there are no the file access restrictions will be. |
The problem here is that a user needs to have access to the file and the folder (and its parents). If the file is restricted to usergroup1 and the folder is restricted to usergroup2 the file is only accessible to users that are in both usergroup1 and usergroup2. You can add multiple groups to the record in solr, but that will give access to users in either group (so OR instead of AND). There is no easy way to add both file and folder restrictions in the correct way. I have made a change that will check for restrictions on the file. If there are no restrictions on the file it will check for restrictions on the folder. It's not a perfect solution, but it's better than how it is now and should be fine in most cases. Pull request: #163 |
See issue #166 |
* 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
It seems that under certain circumstances files indexed with solrfal do not get the correct
access
restrictions set.I had configured like documented:
Imagine that I have set the permissions using the "File" backend module like this:
Any file under "Downloads/Subfolder" is wrongly indexed with
r:0
and it appears in all search results (instead of only if the user has access to group84
).When indexing, this method is called
\BeechIt\FalSecuredownload\Security\CheckPermissions::getPermissions
byfileMetaDataRetrieved
. It will return "empty" (instead of84
) for these files because its logic seems broken.It goes from the root folder up to the folder where the file resides, but aborts after finding any "folderRecord":
One quick'n'dirty solution is currently to only have "folderRecords" on the leafs where the files resides.
Can anybody confirm this is a bug and maybe we can brainstorm about a solution?
The text was updated successfully, but these errors were encountered: