"Access to site files" for using them anywhere

Bug #1638133 reported by Kristina Hoeppner
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
Confirmed
Wishlist
Unassigned

Bug Description

Mahara 16.10

The "Access to site files" option under Admin -> Config site -> Site options -> General settings is currently restricted to making sub folders available in the "Links and resources" menu.

However, when you want to use a file in a subfolder of "public" in a page, people other than the site admin can't see them.

It should be possible to see any files that are in the "public" folder, no matter whether in subfolders or not anywhere else.

It does work properly on mahara.org for the Partner images sitting in TinyMCE in a page that was shared publicly, but I had trouble with images in descriptions in SmartEvidence when I needed to link to the actual file (not through TinyMCE).

All places where "public" is checked would need it be replaced.

At the same time, a setting in the DB should identify a folder as public rather than relying on the folder name "public" as is done at the moment.

For example right now when you rename the folder "public", a new "public" folder is created.

That could then allow institutions to also have public folders (wishlist item bug #1638134)

description: updated
Changed in mahara:
status: New → Confirmed
Revision history for this message
Robert Lyon (robertl-9) wrote :

Currently one way we check if a file can be public is via this (in artefact/file/download.php):

$public = $fileispublic = $file->get('institution') == 'mahara';
$public = $public && (bool)get_field('artefact', 'id', 'id', $fileid, 'parent', ArtefactTypeFolder::admin_public_folder_id());

So the file can only be public if owned bit 'site' and is a child of the 'public' folder.

Another way we check (as in artefact/file/downloadfolder.php) is:

              $publicfolder = ArtefactTypeFolder::admin_public_folder_id();
                $where .= '
                    AND (a.path = ? OR a.path LIKE ?)';
                $phvals = array("/$publicfolder", db_like_escape("/$publicfolder/") . '%');

Where files are seen as public if they live on the 'public' folder's path.

So at the very least we should be consistent.
I feel as long as the file lives within a 'public' folder's path then it should be treated as public

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.