Making WordPress.org


Ignore:
Timestamp:
10/02/2019 08:20:39 AM (7 years ago)
Author:
tellyworth
Message:

HelpHub: fix role assignment for support users.

This fixes a conflict that made it impossible to set a HelpHub role for users with an existing support role.

It also removes an unnecessary edit_theme_options capability for HelpHub editors.

Props Clorith.
Fixes #4700.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-manager/class-helphub-manager.php

    r7958 r9159  
    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        }
Note: See TracChangeset for help on using the changeset viewer.