Making WordPress.org

Ticket #4700: 4700.patch

File 4700.patch, 1.9 KB (added by Clorith, 5 years ago)
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-customroles/class-helphub-custom-roles.php

     
    222222                $default_editorroles = $wp_roles->get_role( 'editor' );
    223223                if ( empty( $GLOBALS['wp_roles']->is_role( $role ) ) ) {
    224224                        $wp_roles->add_role( $role, __( 'HelpHub Editor', 'wporg-forums' ), $default_editorroles->capabilities );
    225 
    226                         $wp_roles->add_cap( $role, 'edit_theme_options' );
    227225                }
    228226        }
    229227}
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-manager/class-helphub-manager.php

     
    181181
    182182                /*
    183183                 * Only allow changing roles of users that are HelpHub related, or do not already hold
    184                  * a role within the user hierarchy as is.
     184                 * a role within the user hierarchy with sufficient capabilities to modify HelpHub articles.
    185185                 *
    186186                 * This is to prevent overriding users with higher capabilities altogether.
    187187                 */
    188                 if ( ! empty( $user_role ) && ! isset( $helphub_roles[ $user_role ] ) ) {
     188                if ( ! empty( $user_role ) && ! isset( $helphub_roles[ $user_role ] ) && user_can( bbp_get_displayed_user_id(), 'edit_posts' ) ) {
    189189                        return;
    190190                }
    191191