Community Documentation

Usage

Last updated February 2, 2009. Created by mr.baileys on February 4, 2008.
Edited by robmilne. Log in to edit this page.

There are many ways to setup a file system hierarchy. The rules of any given system must be applied carefully if security of data is important.

The basic rules for users in a role with 'access webfm' rights:

  • The role root directory defines the domain and all subdirectories that are accessible to the user.
  • The user cannot navigate above the role root directory.
  • Only files in the webfm_file table are accessible. Files uploaded by the user are owned by the user and are automatically in the database. Only module admins can view/operate on files not in the database.
  • The user has full control over files that he/she owns that stay within an accessible role root domain. File permissions can be locked down so that only the owner/admins can see or operate on a file. File permissions can be opened up so that anyone within the role can view or operate on the file.
  • Users with 'access webfm' rights cannot create/delete/move/rename directories. Only module administrators (users with 'administer webfm' permission or #1 user) can control the directory structure.

Roles with 'access webfm' rights can be subsets of other roles with 'access webfm' rights or they can be exclusive. Users can be members of multiple roles and will consequently have a separate left-hand tree for each unique root directory (roles can even share the same root directory).

It is difficult to foresee how diverse users of the module will choose to set up their systems but the following simple examples are typical arrangements. Both examples presume that the drupal file-system directory is set to 'files', the WebFM module is installed and the 'WebFM root directory' is set to 'webfm'.

Example 1

The site requires 1 class of privileged users (A) to administer the file system and 2 classes of WebFM users (B & C) with access to file resources. Both roles will be able to upload files. Some WebFM users are members of both B & C while others are members of only one. The 'Default File Permissions' are set so that uploaded files are initially accessible only by the file owner and admins.

  • A site administrator will create 3 the roles A, B and C. Role A will have the 'administer webfm' permission set in .../admin/user/access. B & C will have the 'access webfm' and the 'webfm upload' permission set.
  • WebFM settings will now have a fieldset for roles B & C where the root directory for each role is set. The root of B is set to 'B' which automatically creates the 'files/webfm/B' directory. The root of C is set to 'C' which creates the directory 'files/webfm/C'. A user who is a member of only one of B or C will see a single left-hand directory tree that contains their domain. They will have no access to files within the other role domain. Users who are members of both B & C will have two left-hand directory trees and have the ability to move files they own or control between the two domains.

    Role A's root directory is the 'WebFM root directory' and thus A users see only a single left-hand tree of the entire module file-sys.

  • In WebFM settings, the 'Default File Permissions' are configured with all checkboxes unset. This combination of default file permissions means that files that are uploaded will initially only be viewable by the B or C user doing the upload (owner) and by A users. Individual file permissions are editable by the file owner or A user to permit other users to view/attach/modify the file. One consequence of granting the permission 'Role Full Access' is that a non-admin user with a single domain could lose contact with their own file if a dual domain non-admin user moves it to the other domain.

Example 2

The site requires 1 class of privileged users (A) to administer the file system and 2 classes of users (B & C) with access to file resources. C is determined to be a subset of B such that B can access its own files as well as those of C. C will not be able to upload files to the browser but will only be able to view/download or attach files to nodes. B will be able to upload files.

  • A site administrator will create 3 the roles A, B and C. Role A will have the 'administer webfm' permission set in .../admin/user/access. B & C will have the 'access webfm' permission set. B will also have the 'webfm upload' permission set.
  • WebFM settings will now have a fieldset for roles B & C where the root directory for each role is set. First the root of B is set to 'B' which automatically creates the 'files/webfm/B' directory. Next the root of C is set to 'B/C' which creates the directory 'files/webfm/B/C'. Since C is a sub-dir of B, role B will have access to C but C will not be able to navigate above its root to see B's files. The left-hand directory tree will appear different for B & C. B's tree will start at 'B' and have a 'C' sub-directory (and potentially other sub-directories as set up by A). C's tree is a subset of B's tree.

    Role A's root directory is the 'WebFM root directory'.

  • In WebFM settings, the 'Default File Permissions' are configured with 'Role View Access' and 'Role Attach Access' set. This combination of file permissions means that files that a B user uploads/moves into the C realm will by default be viewable by C and be attachable to nodes that C creates. A B file owner can manually modify the file permissions of each individual file to hide it or prevent it from being attached to content by a C user. Likewise the file permissions can be opened so that a C user can edit file attributes or move the file into another sub-directory of C.

In the above examples the site administrator may simply create the roles/access rules and then let an A user configure WebFM for B & C.

Comments

how can I link to the files in webfm?

I can upload files there, but how can I use them other than just click and download, say, how can I link to the files there in a different drupal blog node?

Right click on the file name

Right click on the file name and choose "Copy link to clipboard".

How to attach a file to multiple nodes?

http://drupal.org/project/webfm says that webfm allows attaching a file to multiple nodes, but how does one do this? I can't find it anywhere.

Thanks,
Andrew.

You can navigate to the edit

You can navigate to the edit form of the node you want to a attach a file to and do that. If you want to attach the same file to another node, go to that node and edit it and attach the file.

So the only way is to

So the only way is to manually attach the file onto every node? Whew, that does not sound like a good solution.

How can I search a file on its metadata?

When I upload a file and add its description, how can I search the file based on word(s) in the description?

.

How can I get WebFM to actually show up? It's nowhere in any menus, no matter how often I clear caches... All settings're right, though.

Oh, and I'd prefer to have the one role that has access to it to have access to the root folder, not to a root folder within the root folder. Is that possible?

In Navigation Menu

It should show as a link in the main Navigation menu: for me (Drupal 6) it shows above the 'Create Content' and 'Administer' menu links.

Attaching and deleting files to a node with WebFM

Hi, thanks great module, but am having trouble with 2 things:

1: How to attach a file already uploaded via Web FM to a node?
I have tried right-clicking and selecting "Copy link to Clipboard". Then am I supposed to paste this link into the node?
This isn't working for me.
How would I make the file appear as an attachment?

2: How to delete a file attached to a node (without deleting it from the file system altogether)?

Edit: Figured this out - Just needed to change the default file permissions at Site Configuration > Web FM, and those for the file in question (right click file > file permissions). Once the file has proper permissions (Role Attach), this option becomes available in the right-click context menu :)

Site Building Guide

Drupal’s online documentation is © 2000-2012 by the individual contributors and can be used in accordance with the Creative Commons License, Attribution-ShareAlike 2.0. PHP code is distributed under the GNU General Public License.
nobody click here