Public Folder Handling - Subfolders
Reproduce Issue:
Create a Folder and upload some files. Make the folder "Public". Now, add a subfolder.
Result:
Subfolder automatically inherits the "public" setting, which is desired (mostly). However if you then send a link to the parent "public" folder, users will be able to see its sub-files but NOT its sub-folders!
Ideas:
Some of the implementation of the Public Folder always struck me as a bit fishy, at the time we implemented it, we didn't know nearly as much as we do now about the gallery apis. We should look into this as see if we can clean up the implementation. Maybe test to see if the parent folder is also public, in which case the sub-folder is browsable. Maybe make the "hidden" attribute separate from the "public".
Create a Folder and upload some files. Make the folder "Public". Now, add a subfolder.
Result:
Subfolder automatically inherits the "public" setting, which is desired (mostly). However if you then send a link to the parent "public" folder, users will be able to see its sub-files but NOT its sub-folders!
Ideas:
Some of the implementation of the Public Folder always struck me as a bit fishy, at the time we implemented it, we didn't know nearly as much as we do now about the gallery apis. We should look into this as see if we can clean up the implementation. Maybe test to see if the parent folder is also public, in which case the sub-folder is browsable. Maybe make the "hidden" attribute separate from the "public".
Leave a comment
on 2011-04-14 14:48 *
By joseph.gay
Assigned to set to joseph.gay
Status changed from New to Accepted
on 2011-04-14 16:54 *
By joseph.gay
Unable to reproduce thus far having tried:
* Root -> Create Folder -> Upload -> Make Public -> Add subfolder -> Guest Access
* -> Remove Public Folder Hierarchy View permissions -> Make Non-Public -> Make Public -> Guest Access
* -> Unprivileged User Access
* Root -> Create Folder -> Create Subfolder -> Upload to subfolder -> Make Subfolder Public -> Create Subsubfolder -> Guest / Unprivileged Access
* -> Create Subsubsubfolder -> Guest / Unprivileged Access to Subsubfolder
on 2011-04-14 17:22 *
By joseph.gay
Testing an old public folder structure on Collab still couldn't reproduce the subfolder behavior.
The code to add subfolder session permissions is in iPOVhidden->module->onLoad, which calls iPOV_HiddenHelper::addPermissionToSession, which recursively adds the session permission for the folder and any child folders.
The core API call used to obtain the child ids is fetchChildItemIdsIgnorePermissions, which internally uses buildItemQuery with a base query of '[GalleryChildEntity::parentId] = ?'. If something is going wrong there, it could be an issue with the integer -> string ID conversion, though I'm not sure.
The code to add subfolder session permissions is in iPOVhidden->module->onLoad, which calls iPOV_HiddenHelper::addPermissionToSession, which recursively adds the session permission for the folder and any child folders.
The core API call used to obtain the child ids is fetchChildItemIdsIgnorePermissions, which internally uses buildItemQuery with a base query of '[GalleryChildEntity::parentId] = ?'. If something is going wrong there, it could be an issue with the integer -> string ID conversion, though I'm not sure.