diff options
author | Will Woods <wwoods@redhat.com> | 2009-09-18 17:32:59 -0400 |
---|---|---|
committer | Will Woods <wwoods@redhat.com> | 2009-09-18 17:32:59 -0400 |
commit | 202f8001775dc83906dc6f12bc3ab7905a42b872 (patch) | |
tree | 4bf27cd02afaade747e85db9a562b6eee26baf29 | |
parent | 6055034754c3e099951e5f24f154fd2fbeab2a90 (diff) | |
download | israwhidebroken-202f8001775dc83906dc6f12bc3ab7905a42b872.tar.gz israwhidebroken-202f8001775dc83906dc6f12bc3ab7905a42b872.tar.xz israwhidebroken-202f8001775dc83906dc6f12bc3ab7905a42b872.zip |
Fix identity requirements, add some comments
-rw-r--r-- | israwhidebroken/controllers.py | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/israwhidebroken/controllers.py b/israwhidebroken/controllers.py index 6c2797b..ff4a2cc 100644 --- a/israwhidebroken/controllers.py +++ b/israwhidebroken/controllers.py @@ -16,14 +16,15 @@ def to_int(fstr): class Root(controllers.RootController): # Main index page @expose(template="israwhidebroken.templates.index") - def index(self, c=0): + def index(self, c=None): if not c: newest_tree = Tree.select(orderBy='-compose_id')[0] c = newest_tree.compose_id # FIXME BLUH WIDGETIFY THIS - return dict(in_qa='qa' in identity.current.groups, + # TODO need id of prev/next compose for navigation/browsing + return dict(c=c, + in_qa='qa' in identity.current.groups, admin='qa-admin' in identity.current.groups, - c=c, tests=Test.select(), trees=Tree.select(Tree.q.compose_id == c)) @@ -50,7 +51,9 @@ class Root(controllers.RootController): tree_results = self._tree_select(*args, **kw) return dict(trees=list(tree_results)) - @identity.require(identity.in_group("qa-admin")) + # XXX get_results()? + + @identity.require(identity.in_group("qa")) @expose(allow_json=True) def add_tree(self, arch, compose_id, tree_time=None, repodata_time=None): # check to see if tree already exists @@ -79,11 +82,13 @@ class Root(controllers.RootController): hub.commit() # XXX necessary? return dict(id=tr.id) - @identity.require(identity.in_group("qa-admin")) + @identity.require(identity.in_group("qa")) @expose(allow_json=True) def delete_result(self, id): return dict(youwantedtodelete=id, thisisastub=True) + # XXX: delete_tree()? (would require qa-admin) + # Identity stuff (login/logout) @expose(template="israwhidebroken.templates.login") @expose(allow_json=True) |