S Sneedly39 New member Sep 10, 2021 #1 Hi, Is there any documentation on using the XF\Permission\FlatContentPermissions class? I'm trying to create a chat add-on and I'm trying to have per-chatroom permissions but I have absolutely no clue how permissions work. Cheers.
Hi, Is there any documentation on using the XF\Permission\FlatContentPermissions class? I'm trying to create a chat add-on and I'm trying to have per-chatroom permissions but I have absolutely no clue how permissions work. Cheers.
X Xon Well-known member Sep 12, 2021 #2 It is relatively straight forward, but does require extensive knowledge of how XenForo permissions already work. Example; XenForo2-ReportImprovements/upload/src/addons/SV/ReportImprovements/Permission/ReportQueuePermissions.php at main · Xon/XenForo2-ReportImprovements A Collection of improvements to XF2's reporting system. - Xon/XenForo2-ReportImprovements github.com Overview of the functions; getAnalysisTypeTitle/getContentList/getContentTitle Is for the analyze permissions feature. It assumes that the entire list of permissioned things can easily display in a select box. Otherwise it just doesn't do anything. isValidPermission Is used to filter from all valid permissions to the subset to be computed into the per-content permission hash-table. This is applied to every permission definition. getFinalPerms Compiles the permissions into a flat key-value array from a <group><key><value> set. Works on filtered permission definitions via isValidPermission getFinalAnalysisPerms Is for the analyze permissions feature. Compiles the permissions into a list of flat key-value for display saying what has been done.
It is relatively straight forward, but does require extensive knowledge of how XenForo permissions already work. Example; XenForo2-ReportImprovements/upload/src/addons/SV/ReportImprovements/Permission/ReportQueuePermissions.php at main · Xon/XenForo2-ReportImprovements A Collection of improvements to XF2's reporting system. - Xon/XenForo2-ReportImprovements github.com Overview of the functions; getAnalysisTypeTitle/getContentList/getContentTitle Is for the analyze permissions feature. It assumes that the entire list of permissioned things can easily display in a select box. Otherwise it just doesn't do anything. isValidPermission Is used to filter from all valid permissions to the subset to be computed into the per-content permission hash-table. This is applied to every permission definition. getFinalPerms Compiles the permissions into a flat key-value array from a <group><key><value> set. Works on filtered permission definitions via isValidPermission getFinalAnalysisPerms Is for the analyze permissions feature. Compiles the permissions into a list of flat key-value for display saying what has been done.