diff --git a/buddypress.org/public_html/wp-content/plugins/buddypress-org/buddypress-dot-org.php b/buddypress.org/public_html/wp-content/plugins/buddypress-org/buddypress-dot-org.php index f5e10a356c..421c02a945 100644 --- a/buddypress.org/public_html/wp-content/plugins/buddypress-org/buddypress-dot-org.php +++ b/buddypress.org/public_html/wp-content/plugins/buddypress-org/buddypress-dot-org.php @@ -52,13 +52,9 @@ function bporg_remove_dashboard_widget( $admin ) { * @return if user is an admin */ function bporg_admin_redirect() { - if ( is_super_admin() - || current_user_can( 'contributor' ) - || current_user_can( 'author' ) - || current_user_can( 'editor' ) - || current_user_can( 'administrator' ) - ) + if ( is_super_admin() || current_user_can( 'edit_posts' ) ) { return; + } // Allow registered unprivileged admin-ajax.php requests for // profiles.wordpress.org to pass through. diff --git a/phpcs.xml.dist b/phpcs.xml.dist index 447c8ac037..2e37839206 100644 --- a/phpcs.xml.dist +++ b/phpcs.xml.dist @@ -122,9 +122,90 @@ 0 - - - 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/wordpress.org/public_html/wp-content/plugins/photo-directory/inc/moderation.php b/wordpress.org/public_html/wp-content/plugins/photo-directory/inc/moderation.php index a5a70f3fa3..02ebbd447c 100644 --- a/wordpress.org/public_html/wp-content/plugins/photo-directory/inc/moderation.php +++ b/wordpress.org/public_html/wp-content/plugins/photo-directory/inc/moderation.php @@ -291,7 +291,7 @@ public static function disable_own_post_editing( $caps, $cap, $args, $user ) { } // Bail if user isn't a moderator. - if ( ! user_can( $user->ID, 'photos_moderator' ) ) { + if ( ! user_can( $user->ID, 'edit_photos' ) ) { return $caps; } diff --git a/wordpress.org/public_html/wp-content/plugins/plugin-directory/admin/class-customizations.php b/wordpress.org/public_html/wp-content/plugins/plugin-directory/admin/class-customizations.php index f965fa9780..1d19689555 100644 --- a/wordpress.org/public_html/wp-content/plugins/plugin-directory/admin/class-customizations.php +++ b/wordpress.org/public_html/wp-content/plugins/plugin-directory/admin/class-customizations.php @@ -826,7 +826,7 @@ public function custom_comment_row_actions( $actions, $comment ) { if ( 'internal-note' === $comment->comment_type && isset( $_REQUEST['mode'] ) && 'single' === $_REQUEST['mode'] ) { $allowed_actions = array( 'reply' => true ); - if ( current_user_can( 'manage_comments' ) ) { + if ( current_user_can( 'moderate_comments' ) ) { $allowed_actions['trash'] = true; $allowed_actions['untrash'] = true; $allowed_actions['quickedit'] = true; diff --git a/wordpress.org/public_html/wp-content/plugins/plugin-directory/admin/tools/class-elasticsearch-status.php b/wordpress.org/public_html/wp-content/plugins/plugin-directory/admin/tools/class-elasticsearch-status.php index 244b1bcab5..0c988533bf 100644 --- a/wordpress.org/public_html/wp-content/plugins/plugin-directory/admin/tools/class-elasticsearch-status.php +++ b/wordpress.org/public_html/wp-content/plugins/plugin-directory/admin/tools/class-elasticsearch-status.php @@ -27,14 +27,14 @@ public function add_to_menu() { 'plugin-tools', 'ES Index Status', 'ES Index Status', - 'plugin_admin', + 'plugin_approve', 'es-index-status', array( $this, 'render' ) ); } public function render() { - if ( ! current_user_can( 'plugin_admin' ) ) { + if ( ! current_user_can( 'plugin_approve' ) ) { return; } @@ -249,7 +249,7 @@ function tick() { public function ajax_check_batch() { check_ajax_referer( 'es-index-check-batch' ); - if ( ! current_user_can( 'plugin_admin' ) ) { + if ( ! current_user_can( 'plugin_approve' ) ) { wp_send_json_error( 'Permission denied.' ); } @@ -294,7 +294,7 @@ public function ajax_check_batch() { public function ajax_reindex() { check_ajax_referer( 'es-index-check-batch' ); - if ( ! current_user_can( 'plugin_admin' ) ) { + if ( ! current_user_can( 'plugin_approve' ) ) { wp_send_json_error( 'Permission denied.' ); }