XF 1.5 Question on retrieving node permissions by user group instead of user id


Active member

We're trying to retrieve node permissions by user group instead of user id. For now, we're looking specifically at user groups 1 (Unregistered) and 2 (Registered).

Based on reading the KB article and other posts here, it seems like we have to use the permission combinations to do that, but we're not 100% sure of the logic. Our understanding of permission combinations is that they're a way to find permissions for a user who is in all of the groups in user_group_list.

Currently we have something like this:

For the user group, fetch the permission combination where user_id = 0 and user_group_list = "<1|2>".

XenForo_Node_Model->getNodePermissionsForPermissionCombination(<combination ID>)

  • Can we assume there will be exactly 1 row in xf_permission_combinations where user_id = 0 AND user_group_list = "<1|2>"?
  • How would we fetch the correct permission combination for other user groups, where it appears that there is no row for that group in user_group_list by itself?
Thanks in advance...


Well-known member
This isn't a valid approach to resolving the effective XF permissions as, XF permissions are a combination of every group by user and by groups from the content (ie node) and then per-user permissions from content.

You would end up needing to get multiple rows from xf_permission_entry_content and xf_permission_entry tables, and manually combine them.

Generally, you need to fetch the permission_combination_id for a user and pass that down.


Active member

So to confirm:

There's no way to get permissions at the group level even if there is a permission_combination with user_id=0 and user_group_list="<user_group_id>"?

i.e., the only way would be to find a user who is in *only* the group in question and get their permissions?