We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 15083
    • 697 Posts
    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?

      • 15083
      • 697 Posts
      anyone? I want to do with files what MODx does with resources?
        • 36404
        • 307 Posts
        hi,

        i think you can achive this using TVs to store your files as you can use group/user permissions on TVs

        just add a TV where you want to add the file, choose file as the input value, set the permissions you want and the trick should be done smiley

        have swing
          réfléchir avant d'agir
          • 15083
          • 697 Posts
          Quote from: virtualgadjo at Jun 11, 2010, 07:21 AM

          hi,

          i think you can achive this using TVs to store your files as you can use group/user permissions on TVs

          just add a TV where you want to add the file, choose file as the input value, set the permissions you want and the trick should be done smiley

          have swing

          Ahhhh, interesting. I will look into this.
          TY for the reply.
            • 15083
            • 697 Posts
            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
              • 28042 ☆ 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.
                Studying MODX in the desert - http://sottwell.com
                Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                Join the Slack Community - http://modx.org
                • 15083
                • 697 Posts
                thanks for the reply Susan, can the user browse "back" from admin and get into the rest of assets/files/
                ??
                  • 28042 ☆ A M B ☆
                  • 24,524 Posts
                  No, the path you set for the user is the "top" of his browser.
                    Studying MODX in the desert - http://sottwell.com
                    Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                    Join the Slack Community - http://modx.org