Last edited:
> -- Dumping data for table `xf_permission_entry_content`
> --
>
> INSERT INTO `xf_permission_entry_content` (`permission_entry_id`, `content_type`, `content_id`, `user_group_id`, `user_id`, `permission_g roup_id`, `permission_id`, `permission_value`, `permission_value_int`) VALUES
> (1, 0x6e6f6465, 2, 0, 0, 0x67656e6572616c, 0x766965774e6f6465, 'reset', 0);
SELECT content_id, title
FROM xf_permission_entry_content xp
LEFT JOIN xf_node xn ON (xp.content_id = xn.node_id)
WHERE content_type = 'node'
AND permission_group_id = 'general'
AND permission_id = 'viewNode'
AND permission_value = 'reset'
AND user_group_id = 0
AND user_id = 0
So just changed a forum from public to private, this is the permission entry for that.
Let's take that fun.
(1, 0x6e6f6465, 2, 0, 0, 0x67656e6572616c, 0x766965774e6f6465, 'reset', 0); =>
(1, 'node', 2, 0, 0, 'general', 'viewNode', 'reset', 0);
That's informative. We just need to search for permission entries which are generally resetting view permissions for nodes for all user groups.
So the query would be
SQL:SELECT content_id, title FROM xf_permission_entry_content xp LEFT JOIN xf_node xn ON (xp.content_id = xn.node_id) WHERE content_type = 'node' AND permission_group_id = 'general' AND permission_id = 'viewNode' AND permission_value = 'reset' AND user_group_id = 0 AND user_id = 0
FWIW, this seems to work in v2.1 as well.So just changed a forum from public to private, this is the permission entry for that.
Let's take that fun.
(1, 0x6e6f6465, 2, 0, 0, 0x67656e6572616c, 0x766965774e6f6465, 'reset', 0); =>
(1, 'node', 2, 0, 0, 'general', 'viewNode', 'reset', 0);
That's informative. We just need to search for permission entries which are generally resetting view permissions for nodes for all user groups.
So the query would be
SQL:SELECT content_id, title FROM xf_permission_entry_content xp LEFT JOIN xf_node xn ON (xp.content_id = xn.node_id) WHERE content_type = 'node' AND permission_group_id = 'general' AND permission_id = 'viewNode' AND permission_value = 'reset' AND user_group_id = 0 AND user_id = 0
SELECT xf_post.message, xf_post.username, xf_thread.title AS thread, xf_node.title AS node, xf_post.post_id, xf_post.thread_id FROM xf_post
JOIN xf_thread ON xf_post.thread_id = xf_thread.thread_id
JOIN xf_node ON xf_thread.node_id = xf_node.node_id
WHERE xf_post.message_state = 'visible' AND
NOT EXISTS (
SELECT 1
FROM xf_permission_entry_content
WHERE
xf_permission_entry_content.content_id = xf_node.node_id AND
xf_permission_entry_content.user_id = 0 AND
xf_permission_entry_content.user_group_id = 0 AND
xf_permission_entry_content.permission_value = 'reset' AND
xf_permission_entry_content.permission_id = 'viewNode' AND
xf_permission_entry_content.permission_group_id = 'general' AND
xf_permission_entry_content.content_type = 'node'
)
ORDER BY xf_post.post_date DESC
LIMIT 5
We use essential cookies to make this site work, and optional cookies to enhance your experience.