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 c1e992264b..b78c580c21 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 ebb2fbe37e..784abe98ae 100644
--- a/phpcs.xml.dist
+++ b/phpcs.xml.dist
@@ -119,9 +119,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 8dc2f4726d..21378892b3 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 ( empty( $caps['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 9513e2d278..63158cfedd 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
@@ -819,7 +819,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.' );
}