[development] files owned by uid, patch review request.

ufuk bayburt ufukbay at gmail.com
Sun May 6 23:17:44 UTC 2007

+1 this in core.
I maintain IMCE and it uses folder based quotation for users. It scans
physical directories to get the file list. With this patch in core one can
easily get the files of a user from DB and calculate quota. It would
probably be faster than IMCE's current method. (or wouldn't it?)

For a well organized file system directory, what completes this patch and
what IMCE currently implements partially and will probably improve, is
user(role)-folder associations.

Folders are assigned to user roles, each having its own permission for
browsing, uploading, and other operations like deleting, renaming etc.
Folder names may contain tokens like %uid and %uname to allow more
specialized/personalized directory structure. And a wildcard * can be used
for specifying subfolders.

an example for an admin role (full access to file directory path):
folder1: *
permissions: +upload, +browse(+all files, -own files), +delete(+all, -own)

an example for an editor role (a personal folder to upload + browsing access
to other editors' folders):
folder1: editors/%uname
permissions: +upload, +browse(+all, -own), +delete(+all, -own)
folder2: editors/*
permissions: -upload, +browse(+all, -own), -delete

an example for auth. user role(upload to a shared folder, browse and delete
own files)
folder1: userfiles
permissions: +upload, +browse(-all, +own), +delete(-all, +own)

Note: For limitations/permissions on quantitative values(e.g. user quota),
role precedence setting becomes a necessity when a user has multiple roles.
Will roles in D6 have weight attribute? Was this discussed anywhere?

Then comes the file browser. It will probably have a UI like ftp clients.
Users will only be able to see the folders to which they have browsing

To list files in a folder faster, it would be better to store filepath as
separated into directory name(relative to file directory path) and the
filename(as it is now). I think queries like "SELECT ... WHERE
dirname='foo'" will be faster than queries like "SELECT ... WHERE filepath
LIKE 'foo/'".

Besides that, it may end up where we maintain a folders table. This will be
necessary to get subfolders of a folder without a physical folder scan or
without a query that includes a regular expression. Think about getting
subfolders of the file sytem directory by just using the current files

Actually this resembles the taxonomy system where taxonomy terms are folders
and nodes are files. We should implement a similar but simpler system in
order to make the file system browsable by just querying the DB.

To conclude, i liked this patch and thank Darrel for all efforts.

(I would really want to test the patch througly and see the result of
porting IMCE to the new system before code freeze. I don't know if i will
have time but thanks to Nathan :) i'm not alone anymore in this project.)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/development/attachments/20070507/3c7eae6d/attachment.htm 

More information about the development mailing list