← Back to team overview

mahara-contributors team mailing list archive

[Bug 1638133] Re: "Access to site files" for using them anywhere

 

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

-- 
You received this bug notification because you are a member of Mahara
Contributors, which is subscribed to Mahara.
Matching subscriptions: Subscription for all Mahara Contributors -- please ask on #mahara-dev or mahara.org forum before editing or unsubscribing it!
https://bugs.launchpad.net/bugs/1638133

Title:
  "Access to site files" for using them anywhere

Status in Mahara:
  Confirmed

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)

To manage notifications about this bug go to:
https://bugs.launchpad.net/mahara/+bug/1638133/+subscriptions


References