Handles building content permissions for nodes.
Any type of node permission may be applied to any node. However, when calculated, only the known permissions for the specified node type are used. For example, gallery permissions could be applied to a forum, causing those permissions to be inherited to any child galleries. However, when compiled, the forum only has forum permissions.
| package | XenForo_Permissions | 
|---|
rebuildContentPermissions(\XenForo_Model_Permission $permissionModel, array $userGroupIds, integer $userId, array $permissionsGrouped, array $globalPerms) : array
arrayList of user groups for the collection
integerUser ID for the collection, if there are custom permissions
arrayList of all valid permissions, grouped
arrayThe global permissions that apply to this combination
arraysetNodeDataManually(array $nodeTypes, array $nodeTree, array $nodePermissionEntries)
Generally only needed for testing.
array
array
array
_adjustBasePermissionAllows(array $basePermissions) : array
This allows them to be revoked.
array
arrayAdjusted base perms_buildNodeTreePermissions(integer $userId, array $userGroupIds, array $basePermissions, array $permissionsGrouped, integer $parentId) : array
Note that nodes will have permissions for all node types, but the final permissions for a node only include that node's permissions.
integer
array
arrayBase permissions, coming from global or parent; [group][permission] => allow/unset/etc
arrayList of all valid permissions, grouped
integerID of the parent node.
arrayFinal permissions (true/false), format: [node id][permission] => value_forceNodeWideResetOverride(array $nodeWideEntries, array $nodePermissions) : array
This is used to cause reset to take priority over content allow from a parent, but not content allow from this node.
array
array
arrayUpdated node permissions_getNodeWideEntries($nodeId) : array
array_getUserGroupNodeEntries(integer $nodeId, array $userGroupIds) : array
integer
array
array_getUserNodeEntries($nodeId, $userId) : array
array_nodeSetup()
Only runs if not initialized.
$_globalPerms : array
These permissions can be manipulated if necessary and the global permissions will actually be modified.
$_nodePermissionEntries : array
$_nodeTree : array
This data is traversed to build permissions.
$_nodeTypes : array
$_nodesInitialized : boolean
Many calls to rebuildContentPermissions() may happen on one object.