Index: trunk/extensions/MarkAsHelpful/api/ApiGetMarkAsHelpfulItem.php |
— | — | @@ -8,7 +8,9 @@ |
9 | 9 | $params = $this->extractRequestParams(); |
10 | 10 | |
11 | 11 | // check if current user has permission to mark this item, |
12 | | - $isAbleToMark = wfRunHooks( 'onMarkItemAsHelpful', array( 'mark', $params['type'], $params['item'], $wgUser ) ); |
| 12 | + $isAbleToMark = true; |
| 13 | + |
| 14 | + wfRunHooks( 'onMarkItemAsHelpful', array( 'mark', $params['type'], $params['item'], $wgUser, &$isAbleToMark ) ); |
13 | 15 | |
14 | 16 | $HelpfulUserList = MarkAsHelpfulItem::getMarkAsHelpfulList( $params['type'], $params['item'] ); |
15 | 17 | |
Index: trunk/extensions/MarkAsHelpful/api/ApiMarkAsHelpful.php |
— | — | @@ -11,8 +11,12 @@ |
12 | 12 | |
13 | 13 | $params = $this->extractRequestParams(); |
14 | 14 | |
| 15 | + $isAbleToMark = true; |
| 16 | + |
15 | 17 | // Gives other extension the last chance to speicfy mark as helpful permission rules |
16 | | - if ( !wfRunHooks( 'onMarkItemAsHelpful', array( $params['mahaction'], $params['type'], $params['item'], $wgUser ) ) ) { |
| 18 | + wfRunHooks( 'onMarkItemAsHelpful', array( $params['mahaction'], $params['type'], $params['item'], $wgUser, &$isAbleToMark ) ); |
| 19 | + |
| 20 | + if ( !$isAbleToMark ) { |
17 | 21 | $this->dieUsage( "You don't have permission to do that", 'permission-denied' ); |
18 | 22 | } |
19 | 23 | |