I'm starting to wonder if I shouldn't just give up on topic privacy... :(
Re: Privacy options
« Reply #45, on February 16th, 2012, 11:25 PM »
Would you like to have topic privacy options in Wedge?
| 1. | And remember, post approval is a board level permission, so in topics and message indexes where you have a board or topic id, allowedTo will function normally, but in any place outside of those, like search, recent, unread, etc. the test has to be done separately. |
WHERE t.id_board = {int:current_board}' . (!$settings['postmod_active'] || allowedTo('approve_posts') ? '' : '
AND (t.approved = 1 OR (t.id_member_started != 0 AND t.id_member_started = {int:current_member}))') . '
AND ' . $sort . ' ' . $sort_methods[$sort_by]['cmp'] . ' WHERE {query_see_topic} AND t.id_board = {int:current_board}' . (!$settings['postmod_active'] || allowedTo('approve_posts') ? '' : '
AND (t.approved = 1 OR (t.id_member_started != 0 AND t.id_member_started = {int:current_member}))') . '
AND ' . $sort . ' ' . $sort_methods[$sort_by]['cmp'] . 'As for the t alias
what if the user has moderation perms on the board that a private topic is on...? It should be visible to them, shouldn't it...?
WHERE {query_see_topic}
AND att.attachment_type = 0' . ($attachments_boards === array(0) ? '' : '
AND m.id_board IN ({array_int:boards_can_see})') . (!empty($attachment_ext) ? '
AND att.fileext IN ({array_string:attachment_ext})' : '') .
(!$settings['postmod_active'] || allowedTo('approve_posts') ? '' : '
AND t.approved = 1
AND m.approved = 1') . 'approve_posts is a board level permission, not a global one and in SSI, it isn't loaded. Nor is it loaded for search, recent, unread or indeed anywhere that doesn't explicitly contain topic= or board= in the URL string, so it will always return false, with the exception of true for administrators due to the hard-wiring of always-return-true-for-group-1-users.
Does SSI need to support post moderation? That's a good question. My gut instinct says that for the purpose for which post moderation is normally applied and where SSI is used, it's actually not necessary to worry about and that it would actually likely confuse users rather than reassure them.
I'd suggest:
- doing {query_see_topic} anywhere in the WHERE when no particular params are given,
- doing {query_see_topic} instead of t.approved = {int:is_approved} anywhere t.approved shows up in a query.
I do know, though, that global moderators (group ID 3 or something?) probably don't get the benefits of viewing unapproved posts... That should be changed, too...?
| 1. | Bearing in mind that boardsAllowedTo() returns array(0) for admins so a simple in_array won't work either. |