XF 2.0 Updating a user's permission combination ID via PHP?

samuel#0001

New member
I have a PHP script that directly edits user_group_id and secondary_group_ids from the database. The problem with this is that it doesn't matter what values are in those two things if the permission_combination_id isn't also updated. Is there a way I can maybe refresh their combination ID based on their new groups inside of my PHP script?

If not, I'm open to more ideas on how to edit their groups and permission combination through php.
 
This might be a little much to ask, but would you be able to provide an example of this? I have looked through the docs and many posts but I can't find a good example usage of this.
 
This might be a little much to ask, but would you be able to provide an example of this? I have looked through the docs and many posts but I can't find a good example usage of this.
Search for 'XF:UpdatePermissions' in the code and you will see several different examples of the permissions system being used.
 
I have a PHP script that directly edits user_group_id and secondary_group_ids from the database. The problem with this is that it doesn't matter what values are in those two things if the permission_combination_id isn't also updated. Is there a way I can maybe refresh their combination ID based on their new groups inside of my PHP script?

If not, I'm open to more ideas on how to edit their groups and permission combination through php.
Where you able to figure this out? Because I got some questions about how to do that as well.
 
Where you able to figure this out? Because I got some questions about how to do that as well.
See my post above regarding 'XF:UpdatePermissions'. I created an addon that needed to alter selected forum node permissions for specific forum nodes.

There are a bunch of permission examples in the core code. I suggest you look at them and then ask more detailed questions.
 
Top Bottom