--- a/Allura/allura/lib/repository.py
+++ b/Allura/allura/lib/repository.py
@@ -15,6 +15,7 @@
from allura import model as M
from allura.lib import security
from allura.lib.decorators import require_post
+from allura.lib.security import has_access
from allura.app import Application, SitemapEntry, DefaultAdminController, ConfigOption
log = logging.getLogger(__name__)
@@ -106,17 +107,15 @@
self.repo.upstream_repo.name,
className='nav_child')
]
- # TODO: Fix merge request feature and comment this back in.
- # Commenting it out for now since Request Merge gives a 500.
- #if len(c.app.repo.branches):
- # links.append(SitemapEntry('Request Merge', c.app.url + 'request_merge',
- # ui_icon=g.icons['merge'],
- # className='nav_child'))
+ if len(c.app.repo.branches) and has_access(c.app.repo, 'admin'):
+ links.append(SitemapEntry('Request Merge', c.app.url + 'request_merge',
+ ui_icon=g.icons['merge'],
+ className='nav_child'))
pending_upstream_merges = self.repo.pending_upstream_merges()
if pending_upstream_merges:
links.append(SitemapEntry(
'Pending Merges',
- self.repo.upstream_repo.url + 'merge-requests/',
+ self.repo.upstream_repo.name + 'merge-requests/',
className='nav_child',
small=pending_upstream_merges))
if self.repo.branches: