Skip to:
Content

bbPress.org


Ignore:
Timestamp:
06/16/2017 08:05:09 PM (8 years ago)
Author:
johnjamesjacoby
Message:

Super Moderators: First pass at mapping the meta-capabilities.

This change hooks-up the ability for moderators to edit other users if the super moderator ability is allowed. <3

File:
1 edited

Legend:

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

    r6571 r6572  
    120120
    121121            break;
     122
     123        /** Super Moderators **************************************************/
     124
     125        case 'edit_user'  :
     126        case 'edit_users' :
     127
     128            // Moderators can edit users if super moderators is enabled
     129            if ( bbp_allow_super_mods() ) {
     130
     131                // Users can always edit themselves, so only map for others
     132                if ( bbp_get_current_user_id() !== $user_id ) {
     133                    $caps = array( 'moderate' );
     134                }
     135            }
     136
     137            break;
    122138    }
    123139
Note: See TracChangeset for help on using the changeset viewer.