--- a/ForgeGit/forgegit/git_main.py
+++ b/ForgeGit/forgegit/git_main.py
@@ -24,7 +24,7 @@
from pymongo.bson import ObjectId
# Pyforge-specific imports
-from pyforge.app import Application, ConfigOption, SitemapEntry
+from pyforge.app import Application, ConfigOption, SitemapEntry, DefaultAdminController
from pyforge.lib.helpers import push_config, DateTimeConverter, mixin_reactors
from pyforge.lib.search import search
from pyforge.lib.decorators import audit, react
@@ -53,6 +53,7 @@
def __init__(self, project, config):
Application.__init__(self, project, config)
self.root = RootController()
+ self.admin = GitAdminController(self)
@property
def sitemap(self):
@@ -62,10 +63,12 @@
SitemapEntry(menu_id, '.')[self.sidebar_menu()] ]
def admin_menu(self):
- return []
+ return super(ForgeGitApp, self).admin_menu()
def sidebar_menu(self):
links = [ SitemapEntry('Home',c.app.url, ui_icon='home') ]
+ if has_artifact_access('admin', app=c.app)():
+ links.append(SitemapEntry('Admin', c.project.url()+'admin/'+self.config.options.mount_point, ui_icon='wrench'))
repo = c.app.repo
if repo and repo.status == 'ready':
branches= [ b.name for b in repo.branches ]
@@ -133,6 +136,14 @@
model.GitRepository.query.remove(dict(app_config_id=self.config._id))
super(ForgeGitApp, self).uninstall(project_id=data['project_id'])
+
+class GitAdminController(DefaultAdminController):
+
+ @with_trailing_slash
+ def index(self):
+ redirect('permissions')
+
+
class RootController(object):
@expose('forgegit.templates.index')