Making WordPress.org


Ignore:
Timestamp:
12/17/2024 03:51:11 AM (11 months ago)
Author:
dd32
Message:

Plugin Directory: Users must have 2FA setup in order to close or transfer plugins.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/class-capabilities.php

    r12812 r14300  
    5555        // Start over, we'll specify all caps below.
    5656        $required_caps = array();
     57
     58        // Plugin Committers need to have 2FA to be able to perform any of these actions.
     59        if ( function_exists( 'WordPressdotorg\Two_Factor\user_requires_2fa' ) && class_exists( 'Two_Factor_Core' ) ) {
     60            if ( \WordPressdotorg\Two_Factor\user_requires_2fa( $user ) && ! \Two_Factor_Core::is_user_using_two_factor( $user->ID ) ) {
     61                $required_caps[] = 'do_not_allow';
     62            }
     63        }
    5764
    5865        // Certain actions require the plugin to be published.
Note: See TracChangeset for help on using the changeset viewer.