From b7033ed04a73c8690cf85e6f94377d743eb79447 Mon Sep 17 00:00:00 2001
From: Ripul Kumar <vibethemes@gmail.com>
Date: Mon, 18 Apr 2016 16:57:53 +0530
Subject: [PATCH] check_access should allow access to administrators
---
.../classes/class-bp-notifications-notification.php | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/src/bp-notifications/classes/class-bp-notifications-notification.php b/src/bp-notifications/classes/class-bp-notifications-notification.php
index c417b89..9aa65ab 100644
a
|
b
|
class BP_Notifications_Notification { |
560 | 560 | * false. |
561 | 561 | */ |
562 | 562 | public static function check_access( $user_id, $notification_id ) { |
563 | | global $wpdb; |
564 | 563 | |
565 | | $bp = buddypress(); |
| 564 | if(current_user_can( 'edit_user', $user_id ) || bp_current_user_can( 'bp_moderate' )){ |
| 565 | return 1; |
| 566 | } |
566 | 567 | |
| 568 | global $wpdb; |
| 569 | $bp = buddypress(); |
567 | 570 | return $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(id) FROM {$bp->core->table_name_notifications} WHERE id = %d AND user_id = %d", $notification_id, $user_id ) ); |
568 | 571 | } |
569 | 572 | |