XF 1.2 Bulk Create User Groups and Automate Permissions

Wesker

Well-known 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?
 
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?

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

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.
 
Why do you need to make multiple usergroups? If they all have the same permissions, just use a single usergroup...?
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.
 
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.
 
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.
 
@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.
 
@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.
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.
 
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.

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