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

checkFolderRootline in CheckPermissions->checkFolderRootLineAccess() will return wrong result under some circumstances #238

Open
AlexKvrlp opened this issue Mar 12, 2024 · 0 comments
Assignees

Comments

@AlexKvrlp
Copy link

problem

if some files are in different storages, but its parent folders has the same names, CheckPermissions->checkFolderRootLineAccess() will only return the correct value for the first file.

how to reproduce

Conditions

  • create two storages with non public basePathes (out of web-root)
  • set permissions only to one storage, but not for the other storage.
  • add one example file to each storage directly into the storage root.

Test-Implementation

We need to invoke the BeechIt\FalSecuredownload\SecurityCheckPermission for both files.
I'm using an uploads content element, so that I can iterate over both files.
Then use BeechIt\FalSecuredownload\ViewHelpers\Security\AssetAccessViewHelper to check file permission.
Output the values which are return from AssetAccessViewHelper.

cause

CheckPermissions->checkFolderRootLineAccess() did'not take storage into account while generating the cache Identifier. The hashedIdentifier is only unique for its storage. So, the getHashedIdentifier() will return the same value for equals folder names.

solution

We need to take the storage into account while generating the cache identifier.

I will add an pull request soon.

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

2 participants