Skip to:
Content

Opened 8 years ago

Last modified 7 days ago

#459 reopened task

Consider making moderation forum specific

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

Attachments (6)

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

Download all attachments as: .zip

Change History (53)

comment:1 Trent7 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 so1o7 years ago

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

comment:3 mdawaffe7 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 mdawaffe7 years ago

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

comment:6 sambauers5 years ago

  • Milestone changed from 1.0 to 1.5

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

comment:7 kevinjohngallagher4 years ago

  • Priority changed from normal to high

comment:8 johnjamesjacoby3 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 johnjamesjacoby2 years ago

  • Milestone changed from 2.1 to Future Release

Moving to future release. Should be done in 2.2.

comment:10 johnjamesjacoby2 years ago

  • Milestone changed from Future Release to 2.2

comment:11 jaredatch2 years ago

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

comment:12 JarretC2 years ago

  • Cc JarretC added

comment:13 follow-up: JarretC23 months 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 johnjamesjacoby20 months 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: etivite20 months 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 sooskriszta20 months ago

  • Cc vpundir@… added

comment:17 in reply to: ↑ 15 johnjamesjacoby19 months 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 johnjamesjacoby17 months ago

  • Milestone changed from Future Release to 2.3

Moving to 2.3.

comment:19 jmdodd17 months ago

  • Cc jmdodd@… added

comment:20 netweb17 months ago

  • Cc stephen@… added

jmdodd17 months ago

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

comment:21 johnjamesjacoby17 months 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."

johnjamesjacoby17 months ago

Uses get_users() instead of direct query

comment:22 follow-up: jmdodd17 months 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.

jmdodd17 months ago

Helper functions.

comment:23 in reply to: ↑ 22 johnjamesjacoby17 months 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 jmdodd17 months 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 johnjamesjacoby17 months 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 jaredatch13 months ago

  • Cc jared@… added

comment:27 mercime13 months ago

  • Cc mercijavier@… added

comment:28 johnjamesjacoby11 months 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 johnjamesjacoby8 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 johnjamesjacoby5 months ago

  • Milestone changed from 2.6 to 2.7

Bump to 2.7.

comment:31 netweb5 months ago

Related: #1721

smithwib7 weeks ago

Proposed user and group permissions plugin

comment:32 follow-up: smithwib7 weeks 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.

netweb7 weeks ago

comment:33 netweb7 weeks ago

In 459.4.diff:

Refresh of 459.3.diff to apply cleanly against /trunk

comment:34 in reply to: ↑ 32 netweb7 weeks 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: johnjamesjacoby4 weeks 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 netweb4 weeks 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.

johnjamesjacoby3 weeks ago

Cleaned up and mostly working. Needs testing.

comment:37 johnjamesjacoby3 weeks ago

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

comment:38 johnjamesjacoby3 weeks 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 johnjamesjacoby3 weeks ago

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

comment:40 JarretC3 weeks ago

  • Cc JarretC removed

comment:41 netweb3 weeks 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: netweb3 weeks 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: johnjamesjacoby3 weeks 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 netweb3 weeks ago

Replying to johnjamesjacoby:

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

Cool

comment:45 netweb2 weeks 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 hamzahali8 days 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 netweb7 days 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

Note: See TracTickets for help on using tickets.