Skip to:
Content

bbPress.org

Ticket #2348: toggle_topic_capability.diff

File toggle_topic_capability.diff, 1.1 KB (added by jondavidjohn, 8 years ago)

Patch to only require 'edit_topic' for topic toggle actions.

  • includes/topics/template-tags.php

     
    25362536
    25372537                $topic = bbp_get_topic( bbp_get_topic_id( (int) $r['id'] ) );
    25382538
    2539                 if ( empty( $topic ) || !current_user_can( 'moderate', $topic->ID ) )
     2539                if ( empty( $topic ) || !current_user_can( 'edit_topic', $topic->ID ) )
    25402540                        return;
    25412541
    25422542                $display = bbp_is_topic_open( $topic->ID ) ? $r['close_text'] : $r['open_text'];
  • includes/admin/topics.php

     
    484484                        if ( empty( $topic ) )
    485485                                wp_die( __( 'The topic was not found!', 'bbpress' ) );
    486486
    487                         if ( !current_user_can( 'moderate', $topic->ID ) ) // What is the user doing here?
     487                        if ( !current_user_can( 'edit_topic', $topic->ID ) ) // What is the user doing here?
    488488                                wp_die( __( 'You do not have the permission to do that!', 'bbpress' ) );
    489489
    490490                        switch ( $action ) {