Index: trunk/extensions/LiquidThreads/classes/View.php |
— | — | @@ -354,7 +354,7 @@ |
355 | 355 | } |
356 | 356 | |
357 | 357 | /** |
358 | | - * Workaround for bugs caused by r82686 |
| 358 | + * Workaround for bug 27887 caused by r82686 |
359 | 359 | * @param $request FauxRequest object to have session data injected into. |
360 | 360 | */ |
361 | 361 | static function fixFauxRequestSession( $request ) { |
— | — | @@ -1876,6 +1876,10 @@ |
1877 | 1877 | } else { |
1878 | 1878 | $class .= ' lqt-thread-no-subthreads'; |
1879 | 1879 | } |
| 1880 | + |
| 1881 | + if ( ! $thread->title()->userCan('edit') ) { |
| 1882 | + $class .= ' lqt-thread-uneditable'; |
| 1883 | + } |
1880 | 1884 | |
1881 | 1885 | $class .= ' lqt-thread-wrapper'; |
1882 | 1886 | |
Index: trunk/extensions/LiquidThreads/api/ApiThreadAction.php |
— | — | @@ -108,6 +108,13 @@ |
109 | 109 | } |
110 | 110 | |
111 | 111 | $thread = array_pop( $threads ); |
| 112 | + |
| 113 | + global $wgUser; |
| 114 | + $errors = $thread->title()->getUserPermissionsErrors( 'lqt-split', $wgUser ); |
| 115 | + if ( $errors ) { |
| 116 | + // We don't care about multiple errors, just report one of them |
| 117 | + $this->dieUsageMsg( reset( $errors ) ); |
| 118 | + } |
112 | 119 | |
113 | 120 | if ( $thread->isTopmostThread() ) { |
114 | 121 | $this->dieUsage( 'This thread is already a top-level thread.', |
— | — | @@ -175,6 +182,13 @@ |
176 | 183 | $article = new Article( $title, 0 ); |
177 | 184 | $newParent = Threads::withRoot( $article ); |
178 | 185 | } |
| 186 | + |
| 187 | + global $wgUser; |
| 188 | + $errors = $newParent->title()->getUserPermissionsErrors( 'lqt-merge', $wgUser ); |
| 189 | + if ( $errors ) { |
| 190 | + // We don't care about multiple errors, just report one of them |
| 191 | + $this->dieUsageMsg( reset( $errors ) ); |
| 192 | + } |
179 | 193 | |
180 | 194 | if ( !$newParent ) { |
181 | 195 | $this->dieUsage( 'The parent thread you specified was neither the title ' . |
— | — | @@ -605,6 +619,13 @@ |
606 | 620 | 'no-specified-threads' ); |
607 | 621 | } |
608 | 622 | $thread = array_pop( $threads ); |
| 623 | + |
| 624 | + global $wgUser; |
| 625 | + $errors = $thread->title()->getUserPermissionsErrors( 'edit', $wgUser ); |
| 626 | + if ( $errors ) { |
| 627 | + // We don't care about multiple errors, just report one of them |
| 628 | + $this->dieUsageMsg( reset( $errors ) ); |
| 629 | + } |
609 | 630 | |
610 | 631 | // Validate subject |
611 | 632 | if ( empty( $params['subject'] ) ) { |
— | — | @@ -677,6 +698,14 @@ |
678 | 699 | } |
679 | 700 | |
680 | 701 | $thread = array_pop( $threads ); |
| 702 | + |
| 703 | + global $wgUser; |
| 704 | + $errors = $thread->title()->getUserPermissionsErrors( 'edit', $wgUser ); |
| 705 | + if ( $errors ) { |
| 706 | + // We don't care about multiple errors, just report one of them |
| 707 | + $this->dieUsageMsg( reset( $errors ) ); |
| 708 | + } |
| 709 | + |
681 | 710 | $thread->setSortkey( $ts ); |
682 | 711 | $thread->commitRevision( Threads::CHANGE_ADJUSTED_SORTKEY, null, $reason ); |
683 | 712 | |
Index: trunk/extensions/LiquidThreads/lqt.js |
— | — | @@ -378,7 +378,9 @@ |
379 | 379 | }, |
380 | 380 | |
381 | 381 | 'setupThreadMenu' : function( menu, id ) { |
382 | | - if ( menu.find('.lqt-command-edit-subject').length ) { |
| 382 | + if ( menu.find('.lqt-command-edit-subject').length || |
| 383 | + menu.closest('.lqt_thread').is('.lqt-thread-uneditable') |
| 384 | + ) { |
383 | 385 | return; |
384 | 386 | } |
385 | 387 | |