Index: trunk/extensions/ArticleFeedbackv5/api/ApiViewActivityArticleFeedbackv5.php |
— | — | @@ -242,12 +242,30 @@ |
243 | 243 | * @return array db record rows |
244 | 244 | */ |
245 | 245 | protected function fetchActivity( $title, $feedbackId, $limit = 25, $continue = null ) { |
| 246 | + global $wgUser; // we need to check permissions in here for suppressionlog stuff |
246 | 247 | |
247 | | - $where = array ( |
| 248 | + |
| 249 | + // get afv5 log items PLUS suppress log |
| 250 | + if ( $wgUser->isAllowed( 'aftv5-delete-feedback' ) ) { |
| 251 | + $where = array ( |
| 252 | + 0 => "FOO (log_type = 'articlefeedbackv5') |
| 253 | + OR (log_type = 'suppress' AND |
| 254 | + (log_action = 'oversight' OR |
| 255 | + log_action = 'unoversight' OR |
| 256 | + log_action = 'decline' OR |
| 257 | + log_action = 'request' OR |
| 258 | + log_action = 'unrequest'))", |
| 259 | + 'log_namespace' => NS_SPECIAL, |
| 260 | + 'log_title' => "ArticleFeedbackv5/$title/$feedbackId" |
| 261 | + ); |
| 262 | + // get only afv5 log items |
| 263 | + } else { |
| 264 | + $where = array ( |
248 | 265 | 'log_type' => 'articlefeedbackv5', |
249 | 266 | 'log_namespace' => NS_SPECIAL, |
250 | 267 | 'log_title' => "ArticleFeedbackv5/$title/$feedbackId" |
251 | 268 | ); |
| 269 | + } |
252 | 270 | |
253 | 271 | $where = $this->applyContinue( $continue, $where ); |
254 | 272 | |