Index: trunk/extensions/CodeReview/CodeReview.i18n.php |
— | — | @@ -23,6 +23,9 @@ |
24 | 24 | 'code-prop-changes' => 'Status & tagging log', |
25 | 25 | 'codereview-desc' => '[[Special:Code|Code review tool]] with [[Special:RepoAdmin|Subversion support]]', |
26 | 26 | 'code-no-repo' => 'No repository configured!', |
| 27 | + 'code-create-repo' => 'Go to [[Special:RepoAdmin|RepoAdmin]] to create a Repository', |
| 28 | + 'code-need-repoadmin-rights' => 'repoadmin rights are needed to be able to create a Repository', |
| 29 | + 'code-need-group-with-rights' => 'No group with repoadmin rights exist. Please add one to be able to add a new Repository', |
27 | 30 | 'code-repo-not-found' => "Repository '''$1''' does not exist!", |
28 | 31 | 'code-load-diff' => 'Loading diff…', |
29 | 32 | 'code-notes' => 'recent comments', |
Index: trunk/extensions/CodeReview/ui/CodeRepoListView.php |
— | — | @@ -8,7 +8,18 @@ |
9 | 9 | global $wgOut; |
10 | 10 | $repos = CodeRepository::getRepoList(); |
11 | 11 | if ( !count( $repos ) ) { |
| 12 | + global $wgUser; |
12 | 13 | $wgOut->addWikiMsg( 'code-no-repo' ); |
| 14 | + |
| 15 | + if ( $wgUser->isAllowed( 'repoadmin' ) ) { |
| 16 | + $wgOut->addWikiMsg( 'code-create-repo' ); |
| 17 | + } else { |
| 18 | + $wgOut->addWikiMsg( 'code-need-repoadmin-rights' ); |
| 19 | + |
| 20 | + if ( !count( User::getGroupsWithPermission( 'repoadmin' ) ) ) { |
| 21 | + $wgOut->addWikiMsg( 'code-need-group-with-rights' ); |
| 22 | + } |
| 23 | + } |
13 | 24 | return; |
14 | 25 | } |
15 | 26 | $text = ''; |