We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 2281
    • 13 Posts
    Hi everybody,

    I learned a lot about ACL... but this time, I'm completly trapped !

    So, this is my issue... I have :

    • a TV: tv-img (type picture)
    • Resource Groups: tennis-res, rugby-res, etc.
    • User Groups: tennis-users, rugby-users, etc.
    • Media Sources: tennis-files, rugby-files, etc.

    I managed to only show the right resources to Users (tennis-res for tennis-users, etc.)

    But, what I want is:
    tennis-users should be able to edit the value of tv-img, but they must be restricted to their files (tennis-files)...

    How can I do that ? [ed. note: Askalab last edited this post 13 years, 7 months ago.]
      • 40045
      • 534 Posts
      what happens if you give the usergroup only access to the right media source under "Access Controls"?
        • 2281
        • 13 Posts
        This is what I tested :

        • tv-img use the Media Source root-files
        • tennis-users have rights over tennis-files (which actualy is a subdirectory of root-files)

        In this configuration, tennis-users cannot modify tv-img

        For now, I have to give the root-files access to every users... but I don't want this!
          • 4172
          • 5,888 Posts
          Are this TVs for Tennis-users and rugby-users edited on different resources?

          what is your resource-tree-structure and where do you want to edit which TV-images?

          you can have one dynamic mediasource with a snippet-tag in the mediasource-path and url.

          this snippet could point to different pathes, depending on the resource or where in the resource-tree the edited resource sits.
            -------------------------------

            you can buy me a beer, if you like MIGX

            http://webcmsolutions.de/migx.html

            Thanks!
            • 2281
            • 13 Posts
            Tell me more about this "dynamic mediasource"?! I don't know anything about that...

            Here are my directories for the media sources:
            assets/documents/          // root-files
            assets/documents/tennis/   // tennis-files for tennis-users
            assets/documents/rugby/    // rugby-files for rugby-users
            


            So, I told tv-img to use root-files...
              • 28042 ☆ A M B ☆
              • 24,524 Posts
              In your media source, you can use snippets for the path and URL.
                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
                • 2281
                • 13 Posts
                ok... so I use this :

                a new media source : sport-files, with this path :

                assets/documents/[[getResourceField? &id=`[[UltimateParent]]` &field=`alias`]]/


                Of course, the page alias is correct : each ultimate parent (sport section) has the right alias.
                But this don't work.... and I don't know why !!

                If I output it within my tpl, it's ok: it shows the right directory... but it don't work as a media source directory.
                For example, in a page under the Tennis section, it shows :
                assets/documents/tennis/


                Did I miss something to make this work as a media source? [ed. note: Askalab last edited this post 13 years, 7 months ago.]
                  • 2281
                  • 13 Posts
                  Ok,

                  using this:
                  assets/documents/[[getResourceField? &id=`[[UltimateParent]]` &field=`alias`]]/

                  as a media source url can't work because -apparently- the resource is not loaded when I edit it in the manager.

                  So, I have only two solutions, I think :
                  • root-files media-source reachable by everyone (and I pray for good usages...)
                  • using dynamic path by a snippet within a sport-files media source... based on user-group or user

                  But, this second solution is bad... because if, for example, a user is in different user-groups... I can't manage it!

                  I really wish there is a real solution for my problem: ModX is so good as a CMF...... so, it cannot manage such a "normal" policy?


                  Another time, I write here a description of my wish:
                  assets/documents/          // root-files media source
                  assets/documents/tennis/   // tennis-files media source for tennis-users
                  assets/documents/rugby/    // rugby-files media source for rugby-users
                  assets/documents/soccer/   // soccer-files media source for soccer-users



                  Let say there is a user "John Smith". I want him to be part of tennis-users and rugby-users.

                  When he edits a resource:
                  • adding an image in the content of the document
                  • or editing a tv-img...

                  I want him to be able to show root-files... but without soccer-files, because he doesn't have this access.

                  It's something so simple when you are managing policies in a network domain... that's why I go on asking you ;-)

                  Thanks a lot!!!
                    • 2281
                    • 13 Posts
                    It seems that my problem has no answer (for now).

                    Thank you very much, sottwell, Bruno17 and exside for your help!

                    If I found a way to do this, I'll put it here.
                      • 4172
                      • 5,888 Posts
                      This snippet may do what you want:

                      https://github.com/Bruno17/MIGX/blob/master/core/components/migx/elements/snippets/migxResourceMediaPath.php

                      it doesn't use the alias but the id of the resources.
                      [[migxResourceMediaPath? &pathTpl=`assets/documents/{ultimateparent}/`]]


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

                        you can buy me a beer, if you like MIGX

                        http://webcmsolutions.de/migx.html

                        Thanks!