--- a/ForgeSVN/forgesvn/svn_main.py
+++ b/ForgeSVN/forgesvn/svn_main.py
@@ -25,7 +25,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
@@ -51,6 +51,7 @@
def __init__(self, project, config):
Application.__init__(self, project, config)
self.root = RootController()
+ self.admin = SVNAdminController(self)
@property
def sitemap(self):
@@ -60,10 +61,12 @@
SitemapEntry(menu_id, '.')[self.sidebar_menu()] ]
def admin_menu(self):
- return []
+ return super(ForgeSVNApp, 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'))
return links
@property
@@ -106,6 +109,14 @@
model.SVNRepository.query.remove(dict(app_config_id=self.config._id))
super(ForgeSVNApp, self).uninstall(project_id=data['project_id'])
+
+class SVNAdminController(DefaultAdminController):
+
+ @with_trailing_slash
+ def index(self):
+ redirect('permissions')
+
+
class RootController(object):
@expose('forgesvn.templates.index')