Hi,

I want to know how scald atom files could support privacy delivery, use of private file system of drupal ?
Or is it just for public use of media ?

Thanks.

Comments

jcisio’s picture

General speaking, Scald already has its own access control system, which is better than the private file system, and work with all kind of media. Private file system is just a schema for local files.

That being said, we can extend Scald Image to support private file system (by choosing a destination public:// or private:// when uploading a file). This would be a feature request for 1.1 (we should have 1.0 very soon). Patches are welcome.

jcisio’s picture

Priority: Major » Normal
Issue tags: +Scald-1.1
jcisio’s picture

Status: Active » Fixed

Instead of proposing scheme choices when uploading file (as suggestd #1), which is inconsistent with field settings, now the scheme choice is per bundle. Of course contrib module can change that to per atom (using hook_form_alter() etc.).

With that direction, private file support turns out quite easy: commit e53bed3. Tests are also added with 841e5ec.

This is the last issue with scald-1.1 tag.

Automatically closed -- issue fixed for 2 weeks with no activity.

Shiraz Dindar’s picture

Issue summary: View changes

For anyone like me confused by this, there seems to be a missing part to this equation, and that's actually setting the scald atom locations to private. This seems to do the trick:

/**
 * Implements hook_form_alter().
 */
function ma_scald_form_scald_atom_add_form_add_alter(&$form, &$form_state) {
  if ($upload_location = $form['file']['#upload_location']) {
    $form['file']['#upload_location'] = str_replace('public', 'private', $upload_location);
  }
}

Note that scald atoms otherwise are saved into public (except images, where the atom is saved to the thumbnail field, and inherits whatever that field is set to), and although scald has its own atom-level permissions, any anon user can view a public file directly via its URL, as per the way Drupal works.

Shiraz Dindar’s picture

ie. I didn't see where you can set the file scheme per bundle, as mentioned in comment #3. If someone else sees this, please let me know.

nagy.balint’s picture

The scald_file module does the same as the image provider, except it uses a file field to take the settings from. So its possible to set it up there the same way.