Skip to:
Content

bbPress.org


Ignore:
Timestamp:
06/16/2017 09:32:57 PM (7 years ago)
Author:
johnjamesjacoby
Message:

Super Moderators: Compare the user ID to $args[0] instead.

This change makes sure the proper user IDs are compared, and also prevents super moderators from editing Keymasters (demotions can't come from users with a less capable role than their own.)

File:
1 edited

Legend:

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

    r6573 r6574  
    121121
    122122                // Users can always edit themselves, so only map for others
    123                 if ( bbp_get_current_user_id() !== $user_id ) {
    124                     $caps = array( 'moderate' );
     123                if ( ! empty( $args[0] ) && ( $args[0] !== $user_id ) ) {
     124
     125                    // Super moderators cannot edit keymasters
     126                    if ( ! bbp_is_user_keymaster( $args[0] ) ) {
     127                        $caps = array( 'moderate' );
     128                    }
    125129                }
    126130            }
Note: See TracChangeset for help on using the changeset viewer.