We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 29597 ☆ A M B ☆
    • 350 Posts
    I have a site with many User Groups, for each user group I create a Media Source to restrict each user to only their own folder:

    User A:

    • Media Source: client-a-uploads assets/uploads/client-a/
    • User group: client-a-user-group with Media Source to client-a only

    The problem:
    My TV (main image) is use by every user group and has the default File System Media Source assigned.
    If I log in as User A I am not able to edit the image since it is using the File System Media Source.

    How can I use 1 TV for each user group if the user group only have access to their own Media Source?

    EDIT:

    What I need a solution for is this:

    On the Front End I have a detail page with a main stage image TV: stage_img and a MIGX image gallery: gallery_img.
    I will have about 30-40 clients that need to be able to login and edit their own detail page only.

    They should after login only see and be able to edit their own page and be able to edit the TV's with images from their own image folder.
    They should NOT be able to change or see the profile page or images from other clients.

    This question has been answered by Bruno17. See the first response.

    [ed. note: ThaClown last edited this post 11 years, 7 months ago.]
      MODX Ambassador (NL) | Responsive web design specialist, developer & speaker
      DESIGNfromWITHIN, MPThemes and Any Screen Size
      Follow me on Twitter | Read my blog | My code on GitHub
      • 4172
      • 5,888 Posts
      This isn't possible.

      If the user needs to have access to the TV, wich has the default Filesystem mediasource assigned,
      he needs to have permission for that mediasource, of course.
        -------------------------------

        you can buy me a beer, if you like MIGX

        http://webcmsolutions.de/migx.html

        Thanks!
        • 29597 ☆ A M B ☆
        • 350 Posts
        Ok, thanks.

        Is there any way then to have one TV used by many User groups, but sill have each User Group have their own folder?
          MODX Ambassador (NL) | Responsive web design specialist, developer & speaker
          DESIGNfromWITHIN, MPThemes and Any Screen Size
          Follow me on Twitter | Read my blog | My code on GitHub
          • 4172
          • 5,888 Posts
          I think you can create a mediasource to a folder, where everyone can have access to.
          And give all usergroups access to that mediasource.
            -------------------------------

            you can buy me a beer, if you like MIGX

            http://webcmsolutions.de/migx.html

            Thanks!
            • 29597 ☆ A M B ☆
            • 350 Posts
            Quote from: Bruno17 at Mar 16, 2015, 09:19 AM
            I think you can create a mediasource to a folder, where everyone can have access to.
            And give all usergroups access to that mediasource.

            Yes, but then all user groups will have access to all files right?

            What I need a solution for is this:

            On the Front End I have a detail page with a main stage image TV: stage_img and a MIGX image gallery: gallery_img.
            I will have about 30-40 clients that need to be able to login and edit their own detail page only.

            They should after login only see and be able to edit their own page and be able to edit the TV's with images from their own image folder.
            They should NOT be able to change or see the profile page or images from other clients.
              MODX Ambassador (NL) | Responsive web design specialist, developer & speaker
              DESIGNfromWITHIN, MPThemes and Any Screen Size
              Follow me on Twitter | Read my blog | My code on GitHub
            • discuss.answer
              • 4172
              • 5,888 Posts
              you can have a dynamic mediasource like done here:
              http://rtfm.modx.com/extras/revo/migx/migx.tutorials/migx.use-resource-specific-mediasource-and-multifile-uploader

              but user-specific-mediasource not resource-specific.

              instaed of

              [[migxResourceMediaPath? &pathTpl=`assets/resourceimages/{id}/`]]


              you would have:

              [[migxResourceMediaPath? &pathTpl=`assets/userimages/{username}/`]]

                -------------------------------

                you can buy me a beer, if you like MIGX

                http://webcmsolutions.de/migx.html

                Thanks!
                • 29597 ☆ A M B ☆
                • 350 Posts
                Wow that is great! Thanks so much.

                It work except for that the folder created get a permission of 1341 and MODX is then unable to upload images.
                Any way to force the created folder to be writable?
                  MODX Ambassador (NL) | Responsive web design specialist, developer & speaker
                  DESIGNfromWITHIN, MPThemes and Any Screen Size
                  Follow me on Twitter | Read my blog | My code on GitHub
                  • 4172
                  • 5,888 Posts
                  which version of MIGX are you using?
                  Does the snippet look like here:

                  https://github.com/Bruno17/MIGX/commit/efbbddeb7929371a392251db9df8d11c675951e7
                    -------------------------------

                    you can buy me a beer, if you like MIGX

                    http://webcmsolutions.de/migx.html

                    Thanks!
                    • 29597 ☆ A M B ☆
                    • 350 Posts
                    That was it thanks!
                      MODX Ambassador (NL) | Responsive web design specialist, developer & speaker
                      DESIGNfromWITHIN, MPThemes and Any Screen Size
                      Follow me on Twitter | Read my blog | My code on GitHub
                      • 29597 ☆ A M B ☆
                      • 350 Posts
                      Just one final question.

                      I have a media source now with this as base_url and base_path
                      [[migxResourceMediaPath? &pathTpl=`assets/gallery/{alias}/`&createFolder=`1`]]


                      The solution works great on the detail page. like:

                      <img src="[[*hoofdafbeelding]]" alt="[[*pagetitle]]">


                      The image works, the path is:
                      assets/gallery/client-a/meeting_room.jpg

                      But if I use it on a page in a getResources call:

                      The getResources call:
                      [[!getResources?
                          &parents=`[[*id]]`
                          &tpl=`gallery_row_tpl`
                          &includeTVs=`1`
                          &processTVs=`1`
                          &tvPrefix=``
                          &limit=`0`
                           &sortby=`RAND()`
                      ]]
                      


                      The gallery_row_tpl:
                      <img src="[[+hoofdafbeelding]]" alt="[[+pagetitle]]">
                      


                      The path to the image is wrong:
                      assets/gallery/client-overview/image_001.jpg

                      How do I use this correctly in a getResources call?

                      --------- EDIT ------------

                      I tested usting a MIGX in the getResources tpl:
                      [[!getImageList? &tvname=`image` &tpl=`galleryImage` &limit=`1` &docid=`[[+id]]` ]]


                      And now it works fine! But I don't need a MIGX with several images, just one single image TV.

                      Can I somehow use the &docid=`[[+id]]` in a normal image TV? [ed. note: ThaClown last edited this post 11 years, 7 months ago.]
                        MODX Ambassador (NL) | Responsive web design specialist, developer & speaker
                        DESIGNfromWITHIN, MPThemes and Any Screen Size
                        Follow me on Twitter | Read my blog | My code on GitHub