1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

XF 1.2 Bulk Create User Groups and Automate Permissions

Discussion in 'Troubleshooting and Problems' started by Wesker, Sep 28, 2013.

  1. Wesker

    Wesker Active Member

    I need to make multiple usergroups for a specific mod but don't want to fill out the permissions manually for dozens of usergroups I need to make. They will all have the same exact permissions. How do I automate this so I don't have to manually do each one at a time?
     
  2. Liam W

    Liam W Well-Known Member

    Why do you need to make multiple usergroups? If they all have the same permissions, just use a single usergroup...?
     
  3. Wesker

    Wesker Active Member

    Each one will have a different type of banner/rank. Don't want to have to manually assigned banners to each member. If they upgrade to the different usergroup, it should be fully automated. The only part I'm missing is how to bulk create user groups.
     
  4. Tracy Perry

    Tracy Perry Well-Known Member

    Maybe because he wants to use different user group titles for them (like I'm thinking of doing on one of my forums - HD Owner, Honda Owner, Kawasaki Owner, Suzuki Owner, etc)?
    I could also see the same thing being done on a football related forum.
     
  5. Liam W

    Liam W Well-Known Member

    Ah right, I see now...

    No, there isn't a way built in, at least I'm pretty sure there isn't...

    Liam
     
  6. Wesker

    Wesker Active Member

    Exactly.
     
  7. Wesker

    Wesker Active Member

    Okay so it's not built in but howabout through mySQL. What tables do I need to use besides xf_usergroup (which one is for user permissions) and can I use and basically insert new rows automatically.
     
  8. Martok

    Martok Well-Known Member

    Firstly I'm assuming that you are following the recommended way of using usergroups and have the Registered group as the primary group. That means all of these other groups are secondary ones.

    If all these secondary groups have exactly the same permissions then you could do it this way:

    1. create one user group (let's call it the Promoted group) with the required permissions that all can be assigned to
    2. create the multiple user groups with no additional permissions, just the different banners
    3. Set any required permissions in nodes for the multiple user groups but not the Promoted group

    You can then add users to the Promoted group plus the one additional group that you require.

    Yes, there's a lot of groups to set up but you only have to set permissions in one of them and just banners in the rest.
     
  9. Wesker

    Wesker Active Member

    @Martok

    This works but it wouldn't work for the Ice Shop Mod because it only changes the primary usergroup. Your steps would however would work for an alternative mod but not the Ice Shop Mod.
     
  10. Tracy Perry

    Tracy Perry Well-Known Member

    PLEASE... PLEASE...PLEASE... don't get in the habit of changing the primary group. You can cause yourself MORE headaches than it's worth by doing that. Best Practices follow the "everybody is a Registered Member" and then stack the additional groups on top.
     
    Amaury likes this.
  11. Wesker

    Wesker Active Member

    Is there a guide on this? I need to send this to some devs here and would hope you have a writeup already made.
     
  12. Tracy Perry

    Tracy Perry Well-Known Member

Share This Page