I have a requirement to protect document downloads from the /assets/docs/ folder.
I have accomplished this by using .htaccess to redirect all clients to a php script, that authenticates them and serves the file if they are a valid user.
I need to take the above one step further however! When a user uploads a document/pdf using MODx, is there any way to flag the file as part of a document group. Example:
Manager user who is part of the level1 doc group uploads a pdf.
This file is only available to other Manager users with level1 access.
The overall goal of this is that different levels of manager user can only see documents/pdf docs that were uploaded by a manager of the same level as them. At the moment the only way I can think to do it is to:
1. Disable the Resource Browser and File Manager.
2. Create a module that checks your document groups and handles the file upload, storing the file name in a DB table against the file name.
This has several problems as it breaks the usual workflow. Is there a way to build the logic above into whats already there?
anyone? I want to do with files what MODx does with resources?
Problem remains, I need to associate files to modx manager users.
I then need to feed this association into the resource browser, so a user can only see his files.
This is not going to be easy is it :0
-
☆ A M B ☆
- 24,524 Posts
As far as the file manager goes, you can set the full path for it in the individual user’s User tab, and the file manager will open with that folder as its root.
For the resource browser, you have to have this pointing to a folder that contains folders named "files", "images", "flash" and "media" (just like the default /assets/ folder does).
So I created a folder assets/files/admin, and in the admin folder put the four other folders. Then in the User tab for the manager user (admin) for the File Base Path I put /Applications/MAMP/htdocs/notes/assets/files/admin/, and for the File Browser URL I put assets/files/admin/. Now if I create a TV of the "file" type, it points me at my assets/files/admin/files folder. Also the resource browser for inserting images in the rich text editor points me to the assets/files/admin/images folder.
thanks for the reply Susan, can the user browse "back" from admin and get into the rest of assets/files/
??
-
☆ A M B ☆
- 24,524 Posts
No, the path you set for the user is the "top" of his browser.