This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
4831
Features / Re: Privacy options
« on February 21st, 2012, 07:58 PM »
Yup, only needs one of those things and you get false back overall ;)
4832
Features / Re: Privacy options
« on February 21st, 2012, 06:03 PM »
In which case !allowedTo(array('moderate_forum', 'moderate_board')) should do the job ;)
4833
Features / Re: Privacy options
« on February 21st, 2012, 03:51 PM »
That should do, yes. Mind you, you don't really need to validate that you're in a board, moderate_board will only be set if you're in a board anyway and have the permission (as it can't be set otherwise without mangling the DB directly)
4834
Features / Re: Privacy options
« on February 21st, 2012, 08:58 AM »Actually, we could even do !allowedTo('moderate_board'), but ONLY if the $board variable is set... Right?
OTOH, if it works... Don't fix it before the rest.
will only show that t.approved on !allowedTo('moderate_forum')
4835
Features / Re: Privacy options
« on February 21st, 2012, 01:08 AM »Oh, I see... But aren't people in group 3 also linked to a specific set of permissions...?!
To me, if $user_info['is_mod'] is set on board moderators, if that very variable exists, it should mean to be used, regardless of actual permissions given to the group...
What is a moderator? How do you define a moderator? A moderator is someone who has the permission to moderate_forum or moderate_board. Nothing more. You can, quite readily, create a moderator who has actually less powers than a regular user if you so wish, because you can assign permissions to it.
That's one of the underlying problems in SMF, really. You have the admin group, it has special behaviour because it's the admin group. (It has quite a bit of special behaviour, in fact, not just board access shortcuts, permissions overrides but it's also the only group defined internally as protected, though you can create others, and even then I think group 1 is still considered special in ways other groups are not.)
But the global moderator group is not in any way special, except for the fact it exists in a default installation. Now, in SMF 2.0 (certainly prior to RC4), the group was actually very slightly special, in that it had permissions that were granted and in the tables, but that were nominally disabled (the post moderation permissions were still granted, even if post moderation was disabled) so it gave them access to the mod center even when theoretically they shouldn't have had it. But it was only special because of a buggy permissions loader, not because the group is special itself.
Otherwise, I don't really see the point. And it's exactly the same for global moderators. If one is in that particular group, no matter the permissions, they *should* be able to moderate everything on the forum.
Create a new group, give it all the same permissions as global moderator, specifically moderate_forum. What's the difference between that new group and the original global moderator? Nothing. There is (or at least, should be) no difference whatsoever between that new group and group 2, except for id and irrelevant details like name.
This is what I mean: you can create new groups that behave identically to the global moderator role, and they will behave identically in every single way. But you cannot create a new admin group or a new board moderator group that will behave identically.
You can create groups that emulate their functionality, in that you can create a new group that has every permission in it, is protected etc - but it will not be the same as the real admin group. You can create a group that only has moderate_board permissions in a certain permissions profile, and only apply that profile to a single board, which is the mechanical equivalent to a board moderator as far as permissions go, but it's not the same as a real board moderator.
Groups 1 and 3 are special groups (just as -1 and 0 are special groups as far as permission handling goes) but there is nothing unique about 2 other than it exists. And you cannot and should not rely on it existing, whereas groups 1 and 3 must exist.
This site does not have a group 2 at all. But everything works nonetheless - because SMF was designed not to rely on group 2's existence, and that's been true for at least the 2.0 series.
(Actually, that's not *strictly* true. There are a few places where such things are used but for the most bizarre reasons, namely:
* the query on ManageBoards.php line 469 or so, which says > board_moderator_id (3) or == global_moderator_id (2), when they could have just done > admin (1) && != board_moderator_id (3) for the same real functionality
* ManageMembergroups.php lines 558 and 994, same reason, as is the if() on line 707, though the code on line 785 is something you'd want to do for other groups, not just group 2 if you perform that operation, and 967-968 allows you to delete or modify the group if it is = 2 or any post count group that isn't the 0-post count group
* ManageMedia.php lines 766 and 1745, same as above
That leaves the credits as the only place I can find that explicitly relies on group 2 being, well, group 2.)
Posted: February 21st, 2012, 12:59 AM
Yup, I'm not arguing that it's a mess. But this is why I'm overthinking things - because we need to figure out how much of it to salvage and how much actually needs rewriting.
4836
Features / Re: Privacy options
« on February 21st, 2012, 12:12 AM »No i dont need ssi but it's easier to get the list of topics this way.
Also. Why wouldn't global mods be automatically able to approve posts?
The whole point is that global moderator is not a magic group. 1 is a magic group, 3 is a magic group but there is absolutely nothing special about 2, you could even delete it and things should still work normally. That's why we don't do a test for group 2. On this site, for examine, it would magically ignore me as being a global moderator, which means you end up relying on an assumption that just does not fly.
The only way that works is essentially if you neuter the ability to create global mods just as you cannot create another admin group. You can make it mostly the same but not actually the same for real.
4837
Features / Re: Privacy options
« on February 20th, 2012, 06:08 PM »It's not about me...
Can't they, all?
I don't know, but I know that Wedge.org uses SSI to load the latest post list... And for that reason, I'd like for my moderators to be able to see unapproved posts from the list...
In any case, here's the problem. How do you know, when viewing the front page, who is a moderator and who isn't? approve_posts won't be loaded at all. The only way to determine for certain is to run boardsAllowedTo() and then query filtering on those.
4838
Features / Re: Privacy options
« on February 20th, 2012, 05:05 PM »
Yes, but how often do you use post moderation? How often are there board (or global) moderators who can approve posts? How often are these things viewed outside of boards?
Yes, I also tend to overthink things but for something like this, there is a part of me that feels I have to because it can have all sorts of nasty consequences.
Yes, I also tend to overthink things but for something like this, there is a part of me that feels I have to because it can have all sorts of nasty consequences.
4839
Features / Re: Privacy options
« on February 20th, 2012, 12:37 AM »
But that's the thing... is it the safe solution? It's fine in SSI, sure, but what about recent, unread, unreadreplies... places where you would likely need to be made aware of unapproved posts...?
4840
Features / Re: Privacy options
« on February 19th, 2012, 04:37 PM »
No... just requires more effort in solving the problem. I don't have any answers for this right now :(
4841
Features / Re: Privacy options
« on February 19th, 2012, 04:28 PM »
That's great until you change it, because then it's whatever queries you have to update the board information, then a query for every single user that it directly affects. To take sm.org as an example that means you'd have to issue ~50 queries.
4842
Features / Re: Privacy options
« on February 19th, 2012, 02:00 PM »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...?
To change it so that global moderators (or any non-admin, really) can view unapproved posts, means you have to make multiple other queries to identify who can actually approve posts, with boardsAllowedTo('approve_posts') and then you can do the comparison[1] which strikes me as a headache, especially given that I don't think it's actually that useful an exercise.
| 1. | Bearing in mind that boardsAllowedTo() returns array(0) for admins so a simple in_array won't work either. |
4843
Features / Re: Privacy options
« on February 19th, 2012, 01:05 AM »
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.
The original SSI code does this - excludes unmoderated posts even if the user is otherwise empowered to see them, so in those cases I wouldn't worry about testing for approve_posts or is-owner, I'd simply validate that the post is approved or not (and subject to privacy anyway)
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.
The original SSI code does this - excludes unmoderated posts even if the user is otherwise empowered to see them, so in those cases I wouldn't worry about testing for approve_posts or is-owner, I'd simply validate that the post is approved or not (and subject to privacy anyway)
4844
Features / Re: Privacy options
« on February 18th, 2012, 02:24 AM »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...?
4845
Features / Re: Privacy options
« on February 18th, 2012, 12:39 AM »
I didn't list a specific query, more the fact that those are the rules for topic visibility.
We didn't decide anything specific re where qst should go, though from a convenience perspective, being just a WHERE condition would be pretty handy, especially since being a subselect it wouldn't interfere with the criteria of the parent query so you wouldn't have to ensure t was aliased or anything.
We didn't decide anything specific re where qst should go, though from a convenience perspective, being just a WHERE condition would be pretty handy, especially since being a subselect it wouldn't interfere with the criteria of the parent query so you wouldn't have to ensure t was aliased or anything.