Skip to:
Content

Opened 9 years ago

Last modified 4 months ago

#459 reopened task

Consider making moderation forum specific

Reported by: mdawaffe Owned by:
Milestone: 2.6 Priority: high
Severity: normal Version:
Component: API - Moderation Keywords: needs-testing
Cc: vpundir@…, jmdodd@…, stephen@…, jared@…, mercijavier@…, hamzahali@…

Attachments (7)

459.1.diff (8.0 KB) - added by jmdodd 3 years ago.
Proof-of-concept: forum-mod taxonomy with AJAX-suggested user nicenames.
459.2.diff (8.1 KB) - added by johnjamesjacoby 2 years ago.
Uses get_users() instead of direct query
459.3.diff (14.8 KB) - added by jmdodd 2 years ago.
Helper functions.
leap-bbpress-permissions.zip (19.6 KB) - added by smithwib 15 months ago.
Proposed user and group permissions plugin
459.4.diff (15.3 KB) - added by netweb 15 months ago.
459.diff (18.5 KB) - added by johnjamesjacoby 14 months ago.
Cleaned up and mostly working. Needs testing.
459.5.diff (19.1 KB) - added by netweb 8 months ago.

Download all attachments as: .zip

Change History (62)

comment:1 @Trent8 years ago

  • Resolution set to fixed
  • Status changed from new to closed

This could be considered closed as so10 has created a plugin for this as well.

http://bbpress.org/forums/topic/403?replies=4

Trent

comment:2 @so1o8 years ago

I think it still needs to be a core forum functionality.

comment:3 @mdawaffe8 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

Then let's reopen.

The first step is to make sure we use the right caps everywhere and to make sure they're robust enough.

comment:4 @mdawaffe8 years ago

(In [728]) Clean up edit_deleted cap. It should only be used in meta caps. re #459

comment:6 @sambauers6 years ago

  • Milestone changed from 1.0 to 1.5

Leaving this one in the "maybe later" pile for now.

comment:7 @kevinjohngallagher5 years ago

  • Priority changed from normal to high

comment:8 @johnjamesjacoby4 years ago

  • Milestone changed from Future Release to 2.1
  • Version 0.7.2 deleted

Still valid today and often requested even for bbPress 2.0. Moving to 2.1 to research in next release.

comment:9 @johnjamesjacoby3 years ago

  • Milestone changed from 2.1 to Future Release

Moving to future release. Should be done in 2.2.

comment:10 @johnjamesjacoby3 years ago

  • Milestone changed from Future Release to 2.2

comment:11 @jaredatch3 years ago

Looking forward to this in 2.2 - definitely a very common request and well be a very welcomed feature.

comment:12 @JarretC3 years ago

  • Cc JarretC added

comment:13 follow-up: @JarretC3 years ago

Anybody with any ideas on the best setup for this? The old plugin linked from the original thread posted in the ticket description had the forum moderators setup under the Users menu.

Would this still be an acceptable place for the menu to be or should it be placed somewhere else?

Also, what would be the best place to store the access info? I'm guessing usermeta table with its own row? Would like to work on this to expand my skills but don't want to get too far into it only to have it shot down and require major changes and essentially waste time.

comment:14 in reply to: ↑ 13 @johnjamesjacoby3 years ago

Replying to JarretC:

Anybody with any ideas on the best setup for this? The old plugin linked from the original thread posted in the ticket description had the forum moderators setup under the Users menu.

Also, what would be the best place to store the access info? I'm guessing usermeta table with its own row? Would like to work on this to expand my skills but don't want to get too far into it only to have it shot down and require major changes and essentially waste time.

For a first pass, store an array of user_id's in each forum's postmeta. We can map the 'moderate' cap to the user as we need to after the fact.

This setting will really only be relevant on the forum page. I can see needing to query it from either direction, but we're stuck either way and building a UI inside the profile area to assign which forums to what users is beyond the scope of this ticket.

comment:15 follow-up: @etivite3 years ago

also keep in mind the future bbpress->buddypress group forums and that bbpress may need to know about bp_group_admin_mods_...

maybe mimic the same functions/setup from buddypress but using roles/cap instead of db flags

comment:16 @sooskriszta3 years ago

  • Cc vpundir@… added

comment:17 in reply to: ↑ 15 @johnjamesjacoby3 years ago

  • Component changed from Administration to Moderation
  • Milestone changed from 2.2 to Future Release

Replying to etivite:

also keep in mind the future bbpress->buddypress group forums and that bbpress may need to know about bp_group_admin_mods_...

maybe mimic the same functions/setup from buddypress but using roles/cap instead of db flags

Exactly. We'd map the 'moderate' cap to a user based on what forum they are viewing. Agree we'd want to play nicely with BuddyPress group moderators too.

That said, running out of time in 2.2 to do this, so moving to future release.

comment:18 @johnjamesjacoby3 years ago

  • Milestone changed from Future Release to 2.3

Moving to 2.3.

comment:19 @jmdodd3 years ago

  • Cc jmdodd@… added

comment:20 @netweb3 years ago

  • Cc stephen@… added

@jmdodd3 years ago

Proof-of-concept: forum-mod taxonomy with AJAX-suggested user nicenames.

comment:21 @johnjamesjacoby2 years ago

I like this. The metabox idea is familiar, and an easy win. I think I'm okay with being able to add usernames that don't exist too. Suggesting names says "hey we found these matches" and letting the user add what they want says "hey, that's cool... whatevs."

@johnjamesjacoby2 years ago

Uses get_users() instead of direct query

comment:22 follow-up: @jmdodd2 years ago

In the interest of possibly extending taxonomies to include participate and spectate for better ACL support, changed forum moderator taxonomy from 'forum-mod' to 'bbp-moderate'; helper functions in progress but I need to test them more thoroughly before dealing with assigning/modifying capabilities based on forum.

@jmdodd2 years ago

Helper functions.

comment:23 in reply to: ↑ 22 @johnjamesjacoby2 years ago

Replying to jmdodd:

In the interest of possibly extending taxonomies to include participate and spectate for better ACL support, changed forum moderator taxonomy from 'forum-mod' to 'bbp-moderate'; helper functions in progress but I need to test them more thoroughly before dealing with assigning/modifying capabilities based on forum.

This makes sense to me. Also opens the door back up for Bozo support, too.

comment:24 @jmdodd2 years ago

Helper functions in 459.3.diff have been tested and are working fine with test users and assigning them to moderate forums. Getting back expected results re: forum moderators and moderator's forums.

Rough numbers for the current codebase (r4532):

~200 instances of 'current_user_can', including the following functions that look like they could be consolidated:

  • bbp_current_user_can_publish_forums(), bbp_current_user_can_access_create_forum_form(),
  • bbp_current_user_can_publish_topics(), bbp_current_user_can_access_create_topic_form(),
  • bbp_current_user_can_publish_replies(), bbp_current_user_can_access_create_reply_form().

12 instances of 'bbp_user_can_view_forum'.

20 instances of 'user_can'.

Possibilities:

  • Rolling our own bbp_user_can() (bbp_current_user_can()?) and trying to figure out what we're asking permission for via globals. I'd rather not get too far divorced from WordPress on capability handling so this is not really my favorite solution.
  • A thorough audit to make sure that the relevant forum/topic/reply ids are being passed to current_user_can(), and that the right caps are being checked.
  • Filtering on user_has_cap might also work, but I think passing explicit forum/topic/reply ids is preferable to relying on global values.

comment:25 @johnjamesjacoby2 years ago

  • Milestone changed from 2.3 to 2.4

Looking like a bit of a rabbit hole, so let's move this off to 2.4. This gives us time to iterate on these other architectural issues until then.

comment:26 @jaredatch2 years ago

  • Cc jared@… added

comment:27 @mercime2 years ago

  • Cc mercijavier@… added

comment:28 @johnjamesjacoby2 years ago

  • Milestone changed from 2.4 to 2.5

No movement in a while. No time for 2.4. Moving to 2.5.

comment:29 @johnjamesjacoby22 months ago

  • Milestone changed from 2.5 to 2.6

2.5 is going to focus on performance improvements. Moving to 2.6.

comment:30 @johnjamesjacoby18 months ago

  • Milestone changed from 2.6 to 2.7

Bump to 2.7.

@smithwib15 months ago

Proposed user and group permissions plugin

comment:32 follow-up: @smithwib15 months ago

Per John James Jacoby's suggestion, I've uploaded the draft version of a plugin I wrote. It optionally works with the User Groups plugin by Katz Web Services if installed. It needs some TLC by experts in actions + filters, I18N, etc.

@netweb15 months ago

comment:33 @netweb15 months ago

In 459.4.diff:

Refresh of 459.3.diff to apply cleanly against /trunk

comment:34 in reply to: ↑ 32 @netweb15 months ago

Replying to smithwib:

Per John James Jacoby's suggestion, I've uploaded the draft version of a plugin I wrote. It optionally works with the User Groups plugin by Katz Web Services if installed. It needs some TLC by experts in actions + filters, I18N, etc.

@smithwib Thanks for the upload, will take a look at your plugin soon.

comment:35 follow-up: @johnjamesjacoby14 months ago

Really liking the progress on patches here. There are a few things I'd like to tweak, but overall think this is the way to go. With a patch attached, I'm wondering if we can move this to 2.6, and move bbPress comments to 2.7.

comment:36 in reply to: ↑ 35 @netweb14 months ago

Replying to johnjamesjacoby:

I'm wondering if we can move this to 2.6, and move bbPress comments to 2.7.

Either/or, I've been looking at this with the goal of 'bozo' functionality as bbPress v2.x starts appearing (and/or thinking of appearing) on more wordpress.org sites.

Also of note is 'bbPress Per Forum Moderation' is part of @dragooon's (Shitiz Garg) GSoC proposal.

@johnjamesjacoby14 months ago

Cleaned up and mostly working. Needs testing.

comment:37 @johnjamesjacoby14 months ago

  • Keywords needs-testing added
  • Milestone changed from 2.7 to 2.6
  • Type changed from enhancement to task

comment:38 @johnjamesjacoby14 months ago

The only problem I see with this patch is get_objects_in_term() is not cached, meaning we'll need to add our own setting/busting for this on CRUD actions.

comment:39 @johnjamesjacoby14 months ago

wp_get_object_terms() usage needs to be checked to make sure caching is sufficient also.

comment:40 @JarretC14 months ago

  • Cc JarretC removed

comment:41 @netweb14 months ago

Do we want to list the forums moderators anywhere?

Below screenshot/hack in the forum template notice and/or after the forum description.

https://i.cloudup.com/l6rfiE5s3Z.png

Looking at that above if it was to be in the template notice something more along the lines of:

This forum is moderated by User123, contains 2 topics and 3 replies, and was last updated by admin 2 weeks ago.

I think I may have just answered my own question as to a decision or option, if a forum as 10 moderators this will get ugly quite quickly...

comment:42 follow-up: @netweb14 months ago

Testing 459.diff 'Forum Moderator' vs 'Moderator' capability checks:

  • 'Moderator' can 'edit others topics' - 'Forum Moderators' cannot
  • 'Moderator' can 'edit topic tags' - 'Forum Moderators' cannot
  • 'Moderator' and 'Forum Moderators' can merge, split, close, stick and spam topics/replies

comment:43 in reply to: ↑ 42 ; follow-up: @johnjamesjacoby14 months ago

Replying to netweb:

Testing 459.diff 'Forum Moderator' vs 'Moderator' capability checks:

  • 'Moderator' can 'edit others topics' - 'Forum Moderators' cannot
  • 'Moderator' can 'edit topic tags' - 'Forum Moderators' cannot
  • 'Moderator' and 'Forum Moderators' can merge, split, close, stick and spam topics/replies

This seems fine to me, and the desired result IMO.

comment:44 in reply to: ↑ 43 @netweb14 months ago

Replying to johnjamesjacoby:

This seems fine to me, and the desired result IMO.

Cool

comment:45 @netweb14 months ago

Whilst digging around with topic and reply moderation I found a few issues with topics and replies whose post status is pending.

You cannot view any topics or replies with status pending on the front end, forum moderator, moderator or keymaster included. This includes using the view=all query string.

To view topics and replies and approve them you must be a keymaster and approve them from the backend.

comment:46 @hamzahali13 months ago

  • Cc hamzahali@… added

I did testing for this one, seems working fine, only the add moderator option in forums menu (admin area) seems to be of no use, Till when can we expect this to be included in the core.

comment:47 @netweb13 months ago

hamzahali,

When you are editing a forum when you start typing a name it will populate a dropdown with a list of usernames. At this stage this is expected to be included with the next version of bbPress, though that is not 100% decided just yet.

https://i.cloudup.com/UMvAHIbFIH.png

comment:48 @hamzahali13 months ago

I have done lots of testing of this one, and it seems 100% fine

comment:49 follow-up: @dreamwork10 months ago

The last file, includes/users/functions.php
I couldn't find anywhere to place the code!! Then I just have it placed on the bottom, and I fail!

What version you guys test it for?

comment:50 in reply to: ↑ 49 @netweb10 months ago

Replying to dreamwork:

The last file, includes/users/functions.php
I couldn't find anywhere to place the code!! Then I just have it placed on the bottom, and I fail!

What version you guys test it for?

You need to apply the patch against the bbPress development source code, see the WordPress handbook on working with patches here (and related references in the handbook). If you have any other questions please post on the support forums https://bbpress.org and I'll answer them there as discussing them here in this ticket is not the place for these discussions.

comment:51 @netweb8 months ago

In 459.5.diff a refresh of 459.diff to apply cleanly against /trunk

@netweb8 months ago

comment:52 @sambauers8 months ago

I hope this ticket never closes. I use the email notifications to remind me which decade I'm in.

comment:53 @johnjamesjacoby8 months ago

  • Milestone changed from 2.6 to 3.0

Moved to 3.0, due September 15, 2020. :)

Last edited 8 months ago by johnjamesjacoby (previous) (diff)

comment:55 @slackbot7 months ago

This ticket was mentioned in Slack in #meta by jjj. View the logs.

comment:56 @netweb4 months ago

  • Milestone changed from 3.0 to 2.6

Let's get this into 2.6 and stop being a cheat sheet for @sambauers ;)

p.s. New Year, Same Decade

Note: See TracTickets for help on using tickets.