We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 29635
    • 361 Posts
    Hi all.
    I have a project that I’d love to use MODx for, but I want to make sure it’s possible, and you all seem like such nice people I thought I’d ask:

    Question about (Web) Users & Groups:
    It’s a site that will list classes for (Christian) universities, searchable by potential students. Each university will have it’s own username/pass to be able to add, remove, and modify courses.

    So, the problems I’m having is trying to figure out the web users and their respective permissions. If each university should only be able to edit their own courses, and can only add courses to their own category/folder, does that mean that I’ll need to manually set up a user group and document group for each university?

    When creating content witht he NewsPublisher snippet, where does created content go? I.e., if webuser12 creates a new document, does it go into folder webuser12? (I’ve tried to experiment but can’t get it working right now.)

    Also, would it make more sense to have these users as web users or backend users? If possible, it’d be nice to keep them in the frontend. Is FCK editor available in the NewsPublisher snippet?

    My background, in case anybody cares: I’m a long time (and somewhat reluctant) Mambo/Joomla user; used on probably over 30 client sites. I’ve used Eto in the past, and have been looking for an excuse to switch to MODx, and I have a feeling that this project would be much better for MODx’s more powerful user management abilities.

    Anyway, thanks for any advice! Sorry this is so long. Hopefully it’s clear enough.
    -Brett
      Need MODx Ecommerce? Try FoxyCart!
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      You would need a web user group and a web user assigned to it for each user.

      The NewsPublisher snippet saves its docs in whatever folder you tell it to. So the best way would be for each university to have its own page, and simply use that document as the folder for its stuff. Each university’s page would have its own instance of the NewsPublisher snippet, so each one would be called with the appropriate parameters.

      Each user would be set to go to his university’s page when he logs in. Any other logged-in user who tried to get into his page to edit it would be rejected, since you can specify which user groups can work on that particular instance of the NewsPublisher with &canpost=<list-of-webgroups> So if you had a webgroup for Lubbock Christian College, LubCC, you would put on their page (if it has ID of 42):

      [[NewsPublisher?folder=42&canpost=LubCC]]
      


      Have a user, LubCCUser, who gets sent to page 42 when he logs in, assigned to the LubCC webgroup, and you should be good to go.

      Now about setting up the users and groups for hundreds of universities. This could easily enough be scripted; all you would need to do is to create an array of usergroup names, and user/password/fullname/email/webgroup/loginpage info for each user. Then the script would loop through the arrays, build the queries, and fire them off to the database. You could even have the script email the user with his login name and password, just as the regular Manager user manager does. In fact, you could just have the script use the Manager’s save_user file.

        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
        • 25663 MODX Staff
        • 12,272 Posts
        Hello Brett,

        This is a good application for MODx. And honestly it will get a lot better when we have a better "browser" for web users. Our goal is to be a better/simpler/more capable Mambo/Joomla! (why oh why the exclamation??? lol) btw. wink

        At any rate, our own devteam member Adam Noble is the webmaster for bryan.edu and they have about 2000 pages and 250 users editing content and are now-starting their conversion to MODx.

        Welcome aboard!
          Ryan Thrash, MODX Co-Founder
          Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
          • 29635
          • 361 Posts
          That is great! I completely forgot that snippets could have variables passed to them. Thanks so much for the quick feedback! grin Fastest and friendliest forum I’ve ever seen!

          Two additional questions, one O/T:
          1. Is FCK available in the frontend with the NewsPublisher snippet? If it is, how do the permissions with uploading photos/files work? If it’s not, I supposed it’d be easy enough to make a snippet to add a new item in a popup with the RTE, right?

          2. If I want to have every course description searchable by state, is there a way to give the content editor some sort of dropdown, or an extra field when creating content where they could enter the abbreviation? I remember something about a core hack with Eto to allow for custom content fields, and I think that might be what TVs are, but I’m a little unsure. (Sorry, I’ve actually read the documentation a few times, but I’m still unclear.)
          In other words, I’d like a the main content text box where they could ideally use FCK editor with a premade template, and a separate field where they could select the state where the course is offerred. I could then use the state field to search through courses. (I know there would be ways around this, but I’d like to make it a bit easier on the "web users" creating the content. If there’s a better way, I’m all ears! smiley )
          If this is too off topic, I’ll make a new post. Let me know. Threads on this forum seem to be a bit more flexible than most.

          Anyway, thanks so much! I’m already regretting that I have three other projects in current development with Mambo/Joomla.
          -Brett
            Need MODx Ecommerce? Try FoxyCart!
            • 28042 ☆ A M B ☆
            • 24,524 Posts
            I’ve never used the News Publisher myself, but documents have a name, a long name, a description, and a summary field besides the regular content. I’m sure you could use one of those.
              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
              • 29635
              • 361 Posts
              Thanks Susan. I suppose it wouldn’t be too hard to switch one those from an input box to a select box or something within the snippet. (The NewsPublisher snippet does indeed show page title, long title, description, publish dates, summary, and Content, though the content is plaintext.)

              Just out of curiousity, is there any way to make a new field there, or would that require some core hacks? I remember thinking of countless ways that that sort of functionality could be used last year when I was playing with Eto. Maybe something similar with TVs? (Just thinking out loud, and still trying to figure out some of the new concepts in MODx!)

              Thanks again! Time to try some of these concepts out!
                Need MODx Ecommerce? Try FoxyCart!
                • 28042 ☆ A M B ☆
                • 24,524 Posts
                You should be able to make a snippet with a select, and when the user makes a selection it does a search based on the field you choose, and takes the user to a results page with all the results in a list. I would be inclined to use the description field, since it’s not used for anything important (at least that I can think of...) Then you don’t have to mess with the database at all.
                  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
                  • 28042 ☆ A M B ☆
                  • 24,524 Posts
                  In fact, I would have the query return the ID (for making the link to their document) the pagetitle and the summary, and would build the links with that information. Could be pretty nice.
                    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
                    • 29635
                    • 361 Posts
                    So I’ve built the site and have got it working in three scenarios, one with the users as web users and the others where they’re manager users, but...

                    1. Web Users cannot delete or edit content once it’s up, at least not with any available snippet I can find. Am I wrong here? I think this would be the best way to go, as I could make the whole thing very idiot-proof.

                    2. Manager Users (backend access) have too much access, even with the most limited permissions. Also, the way I’d like the data structured makes it even worse. (See this post regarding parent/child permissions: http://modxcms.com/forums/index.php/topic,1366.0.html.) They also have a lot of extra options like "Export Site" and "Import Site", etc. And there doesn’t seem to be a way to prevent them from moving content to the root directory or even deleting the parent item (which would be bad). As we all know, clients will always screw stuff up, and this just seems like too much risk.

                    3. Manager Users (frontend access only) can’t create or delete items (?), and could still conceivably delete the parent folder if they were given deleting privilidges.

                    I think the best thing would be to modify the QuickEdit plugin to
                    1.) allow editing for web users instead of manager users, and
                    2.) allow editing by the "createdby" document object instead of document group.
                    Does that sound possible, or has somebody already done this perhaps?

                    Incidentally, Template Variables are the coolest things ever.
                    Thanks for any advice! Much appreciated.
                      Need MODx Ecommerce? Try FoxyCart!
                      • 18397
                      • 3,250 Posts
                      Frontend manager users CAN create documents via the newspublisher snippet.