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

Create Categories, Forums and set Permissions

We want to create automatic a new category and create 3 new forums inside.
This should be no problem with the datawriters, but how can we set automatic the permission?

1. create the category with XenForo_DataWriter_Category
2. crate the forums with XenForo_DataWriter_Forum

but what then?


Well-known member
Use the permission model: XenForo_Model_Permission.

Setting node permissions for a usergroup:
	$permissions, 'node', $nodeId, $userGroupId, 0
Setting node permissions for a single user:
	$permissions, 'node', $nodeId, 0, $userId
The permissions array should be in this format:

	[permission_id_1] => [value]
	[permission_id_2] => [value]


	[permission_id_3] => [value]
	[permission_id_4] => [value]
where value is one of these strings:
  • 'unset'
  • 'content_allow'
  • 'reset'
  • 'deny'
  • '0' (integer permission: inherit)
  • '-1' (integer permission: unlimited)
  • Any other positive integer value, if it's an integer permission

  • XenForo_ControllerAdmin_Permission_Node::actionUserGroupSave()
  • XenForo_ControllerAdmin_Permission_Node::actionUserSave()