comparison pylons_app/controllers/changeset.py @ 331:fdf9f6ee5217

Implemented permissions into hg app, secured admin controllers, templates and repository specific controllers
author Marcin Kuzminski <marcin@python-works.com>
date Tue, 29 Jun 2010 20:45:03 +0200
parents 42f5c36820ef
children 183cee110578
comparison
equal deleted inserted replaced
330:c961b78ff0a0 331:fdf9f6ee5217
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # encoding: utf-8 2 # encoding: utf-8
3 # changeset controller for pylons 3 # changeset controller for pylons
4 # Copyright (C) 2009-2010 Marcin Kuzminski <marcin@python-works.com> 4 # Copyright (C) 2009-2010 Marcin Kuzminski <marcin@python-works.com>
5 from pylons import tmpl_context as c, url
6 from pylons.controllers.util import redirect
7 from pylons_app.lib.auth import LoginRequired
8 from pylons_app.lib.base import BaseController, render
9 from pylons_app.model.hg_model import HgModel
10 from vcs.exceptions import RepositoryError
11 from vcs.nodes import FileNode
12 from vcs.utils import diffs as differ
13 import logging
14 import traceback
15 5
16 # This program is free software; you can redistribute it and/or 6 # This program is free software; you can redistribute it and/or
17 # modify it under the terms of the GNU General Public License 7 # modify it under the terms of the GNU General Public License
18 # as published by the Free Software Foundation; version 2 8 # as published by the Free Software Foundation; version 2
19 # of the License or (at your opinion) any later version of the license. 9 # of the License or (at your opinion) any later version of the license.
30 """ 20 """
31 Created on April 25, 2010 21 Created on April 25, 2010
32 changeset controller for pylons 22 changeset controller for pylons
33 @author: marcink 23 @author: marcink
34 """ 24 """
35 25 from pylons import tmpl_context as c, url, request
26 from pylons.controllers.util import redirect
27 from pylons_app.lib.auth import LoginRequired, HasRepoPermissionAnyDecorator
28 from pylons_app.lib.base import BaseController, render
29 from pylons_app.model.hg_model import HgModel
30 from vcs.exceptions import RepositoryError
31 from vcs.nodes import FileNode
32 from vcs.utils import diffs as differ
33 import logging
34 import traceback
36 35
37 log = logging.getLogger(__name__) 36 log = logging.getLogger(__name__)
38 37
39 class ChangesetController(BaseController): 38 class ChangesetController(BaseController):
40 39
41 @LoginRequired() 40 @LoginRequired()
41 @HasRepoPermissionAnyDecorator('repository.read', 'repository.write',
42 'repository.admin')
42 def __before__(self): 43 def __before__(self):
43 super(ChangesetController, self).__before__() 44 super(ChangesetController, self).__before__()
44 45
45 def index(self, revision): 46 def index(self, revision):
46 hg_model = HgModel() 47 hg_model = HgModel()