# HG changeset patch # User Marcin Kuzminski # Date 2013-04-14 23:01:47 # Node ID 244f184f5fc3a8c9b16ca6477ab050c9ae0ce94e # Parent b950b884ab87d386868c1b4e013b374a82f51de4 moved around some code in changeset controllers to properly log which function was decorated. Before it was always index, and permission were checked twice giving unnneded overhead diff --git a/rhodecode/controllers/changeset.py b/rhodecode/controllers/changeset.py --- a/rhodecode/controllers/changeset.py +++ b/rhodecode/controllers/changeset.py @@ -177,10 +177,7 @@ class ChangesetController(BaseRepoContro c.users_array = repo_model.get_users_js() c.users_groups_array = repo_model.get_users_groups_js() - @LoginRequired() - @HasRepoPermissionAnyDecorator('repository.read', 'repository.write', - 'repository.admin') - def index(self, revision, method='show'): + def _index(self, revision, method): c.anchor_url = anchor_url c.ignorews_url = _ignorews_url c.context_url = _context_url @@ -315,20 +312,26 @@ class ChangesetController(BaseRepoContro @LoginRequired() @HasRepoPermissionAnyDecorator('repository.read', 'repository.write', 'repository.admin') + def index(self, revision, method='show'): + return self._index(revision, method=method) + + @LoginRequired() + @HasRepoPermissionAnyDecorator('repository.read', 'repository.write', + 'repository.admin') def changeset_raw(self, revision): - return self.index(revision, method='raw') + return self._index(revision, method='raw') @LoginRequired() @HasRepoPermissionAnyDecorator('repository.read', 'repository.write', 'repository.admin') def changeset_patch(self, revision): - return self.index(revision, method='patch') + return self._index(revision, method='patch') @LoginRequired() @HasRepoPermissionAnyDecorator('repository.read', 'repository.write', 'repository.admin') def changeset_download(self, revision): - return self.index(revision, method='download') + return self._index(revision, method='download') @LoginRequired() @NotAnonymous()