Skip to:
Content

bbPress.org


Ignore:
Timestamp:
06/16/2017 07:45:05 PM (7 years ago)
Author:
johnjamesjacoby
Message:

Capabilities: Logic improvements to help with per-forum moderation.

  • Introduce moderate_forum capability check, used to check if a user has the ability to moderate a specific forum
  • Limit number of direct keep_gate checks, and use bbp_is_user_keymaster() where possible
  • Make bbp_is_user_forum_moderator() check the new moderate_forum mapped capability
  • Have the moderate mapped capability check moderate_forum if the $args[0] can be bubbled up to being a forum ID
  • Map admin post-type areas to their appropriate edit_ capabilities – they are now properly handled via other mapped conditions

This change (along with r6567 & r6569) allows private & hidden forums to appear in forums queries for users who can moderate them.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/includes/topics/capabilities.php

    r6438 r6571  
    6363 * @uses get_post_type_object() To get the post type object
    6464 * @uses bbp_get_public_status_id() To get the  public status id
    65  * @uses bbp_is_user_forum_moderator() To check if the user is a forum moderator
    66  * @uses bbp_get_topic_forum_id() To get the opic forum id
     65 * @uses bbp_get_topic_forum_id() To get the topic forum id
    6766 * @uses apply_filters() Filter capability map results
    6867 *
     
    225224
    226225        case 'bbp_topics_admin' :
    227             $caps = array( 'moderate' );
     226            $caps = array( 'edit_topics' );
    228227            break;
    229228    }
Note: See TracChangeset for help on using the changeset viewer.