#2590 closed defect (bug) (fixed)
Enhance compatibility with per forum moderators
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | Priority: | normal | |
Component: | Support Forums | Keywords: | has-patch commit |
Cc: |
Description
bbPress 2.6 supports per forum moderators. This is handled in bbp_map_primary_meta_caps()
. But the additional checks are not done if no post ID is passed to the WP_User::has_cap()
check.
- In
Topic_Resolution\Plugin::user_can_resolve()
we can use the existing$topic_id
variable. - In
User_Badges\Plugin::is_user_moderator()
usingget_queried_object_id()
seems to work. - Also affected:
Stickies_Compat
and user flagging inUser_Moderation
.
Noticed this while checking how this actually works because @danielbachhuber requested this.
Attachments (3)
Change History (13)
This ticket was mentioned in Slack in #forums by ocean90. View the logs.
8 years ago
#3
@
8 years ago
Yes, it would be best if actions that had a global effect, like flagging, were limited to global moderators. Thanks!
#7
@
8 years ago
- Keywords commit added
Committed everything I could, refreshed the rest in 2590.3.diff.
#8
@
8 years ago
@ocean90: Anything I can do to help move 2590.3.diff forward?
#9
@
8 years ago
- Owner set to ocean90
- Resolution set to fixed
- Status changed from new to closed
In 5523:
This ticket was mentioned in Slack in #meta by sergey. View the logs.
7 years ago
Note: See
TracTickets for help on using
tickets.
It doesn't in moderator views, e.g. 'Archived'.
get_the_ID()
works though.On a related note,
bbp_get_reply_author_id()
should be replaced withget_post_field( 'post_author' )
there, since the function runs for both topics and replies.bbp_get_reply_author_id()
falls back to the same line for topics (with$reply_id = 0
), so this seems more straightforward.2590.2.diff handles some more affected instances in
Moderators
class andwporg-support
theme.Not sure about user flagging though, I think only global moderators should be able to flag users.
Note: The change in
wporg_support_add_moderation_notice()
(wporg-support/functions.php
) is unnecessary at the moment, since per-forum moderators never see that notice:(+X hidden)
link.edit_others_replies' is mapped to 'moderate, but the check doesn't account for per-forum moderators.The latter two points seem worth fixing though, so I kept that change in the patch, but I guess it can be committed separately later.