We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 45613
    • 45 Posts
    Sorry if this is a little long question, but I feel like I need to lay out some background.

    I am working on the design for part of a website. It is going to have Teams with players, schedules and a calendar. A user or group can have multiple teams. Each team will have a variable number of players and a variable number of events that will go on the schedule and / or calendar. The users are totally independent, unless they are part of the same user group and then should see the same resources and could possibly have different roles.

    Based on my reading and some help from several people on this forum, I was thinking about an design using CRCs and custom DB tables, but I got to a point and got stuck. It started off like a good idea, but now, I am not sure this is the best approach, so I need some advise.

    I started off with the approach:

    Use contexts to create different partitions for each user / group. This I think will make the accounts and permissions, and keeping the data separate, much easier.

    Creating a Custom Resource Class (CRC) for teams.
    The main reason for this is again security and not having to worry about who has access to the team, let MODX handle this.

    Use custom tables for Players and Events.
    I think this will be easier because I am going to want to be able to support file uploads of player lists and schedule events.

    Now I envisioned the Front End to have 3 different resources or pages Per Team each with a different template. A Template for Roster, one for Schedule table view, and one for calendar view.

    So, Now for my questions...
    If all I wanted to do was display the roster on a resource using the Team CRC, this would seem to be an easy snippet, get the data and display it. But I have 3 different views from 2 different tables.
    If I create a second resource using the Team CRC in this account and use a snippet for the schedule and a 3rd page with the team CRC and a snippet for the calendar. Well this will work, but now it looks like I have 3 totally different teams, when really they are the same team.
    I could possibly create a second level CRC for roster, schedule, calendar.
    Would they have to be under the Team CRC in the resource tree, and thus show up like that in the menu? Not what I was looking for.
    If they can go anywhere in the Tree, how are they linked or related?

    If I stick with 1 Team CRC, then how do I have 3 different resources (pages) to display the custom data, but be linked to a common CRC.

    Or should I drop the CRC idea, go with all custom tables, snippets, etc. But how can I use MODX built in security and ACLs already in place around a context? Can I define just define a policy and add it to a group? or are there API calls I need to add to some code?

    Again sorry for the length of the question. Hopefully someone will understand what I am asking and be able to provide some help and direction.

    Thanks in advance for any help.
    Bill
      • 4172
      • 5,888 Posts
      for a better understanding for us (and for you) a graphical view of all possible groups/users/teams/players and related frontend-views with all needed permissions would be good.

      I'm not sure at this point, if different contexts and if CRCs are really needed.
      May be this can be much simpler, but I could be wrong, because of missing something.

      I think the graphic could clearify a bit.
        -------------------------------

        you can buy me a beer, if you like MIGX

        http://webcmsolutions.de/migx.html

        Thanks!
        • 45613
        • 45 Posts
        Thanks, let me try to come up with a graphical view, but let me start with this verbal description. The permissions are no more complicated than having another resource on the page. The basic user/group permissions built into MODX are fine, which is why I would like to use them, and not have to duplicate anything.

        A simple table structure would be a
        Team_table (fields "id", "name", ...)
        Roster_table (fields "id", "team_id", "player_name", "class", ...)
        Schedule_table (fields "id", "team_id", "date", "time", "location", "opponent", ...)

        I could add user_id to the team_table, but then I would have to do checks on this every call.

        Here is a more visual example of the Front End of what I am talking about.... http://johnscreekgladiators.com/ It is a high school Athletic website. Imagine 10 sports, some with boys and girls teams. So about 20 teams. That means 20 logins or users, each with access to there own teams pages. I am thinking a context because some what to have there own vanity URL to go right to football like http://www.gladiatorgridiron.com/

        So the boys basketball would have a roster and a schedule and a calendar. now to make this a little more complicated they may have a Varsity team, JV and freshman teams. Each team has there own roster and schedule. But in the case of Boys Basketball they would all be managed by 1 account. - Lets ignore the groups for now.

        There is probably a simple way to link these entries to a resource / context, so that I can use existing code and not have to duplicate existing functions. I am just not seeing it.

        Thanks again for the replies.