Changeset - 01e005cabd4d
[Not reviewed]
beta
0 1 0
Marcin Kuzminski - 13 years ago 2012-06-14 13:29:00
marcin@python-works.com
moved login required into seperate calls for files due to optional API access option
for archives
1 file changed with 11 insertions and 3 deletions:
0 comments (0 inline, 0 general)
rhodecode/controllers/files.py
Show inline comments
 
@@ -61,7 +61,7 @@ log = logging.getLogger(__name__)
 

	
 
class FilesController(BaseRepoController):
 

	
 
    @LoginRequired()
 

	
 
    def __before__(self):
 
        super(FilesController, self).__before__()
 
        c.cut_off_limit = self.cut_off_limit
 
@@ -113,6 +113,7 @@ class FilesController(BaseRepoController
 

	
 
        return file_node
 

	
 
    @LoginRequired()
 
    @HasRepoPermissionAnyDecorator('repository.read', 'repository.write',
 
                                   'repository.admin')
 
    def index(self, repo_name, revision, f_path, annotate=False):
 
@@ -169,6 +170,7 @@ class FilesController(BaseRepoController
 

	
 
        return render('files/files.html')
 

	
 
    @LoginRequired()
 
    @HasRepoPermissionAnyDecorator('repository.read', 'repository.write',
 
                                   'repository.admin')
 
    def rawfile(self, repo_name, revision, f_path):
 
@@ -180,7 +182,8 @@ class FilesController(BaseRepoController
 

	
 
        response.content_type = file_node.mimetype
 
        return file_node.content
 

	
 
    
 
    @LoginRequired()
 
    @HasRepoPermissionAnyDecorator('repository.read', 'repository.write',
 
                                   'repository.admin')
 
    def raw(self, repo_name, revision, f_path):
 
@@ -227,6 +230,7 @@ class FilesController(BaseRepoController
 
        response.content_type = mimetype
 
        return file_node.content
 

	
 
    @LoginRequired()
 
    @HasRepoPermissionAnyDecorator('repository.write', 'repository.admin')
 
    def edit(self, repo_name, revision, f_path):
 
        r_post = request.POST
 
@@ -276,6 +280,7 @@ class FilesController(BaseRepoController
 

	
 
        return render('files/files_edit.html')
 

	
 
    @LoginRequired()
 
    @HasRepoPermissionAnyDecorator('repository.write', 'repository.admin')
 
    def add(self, repo_name, revision, f_path):
 
        r_post = request.POST
 
@@ -330,6 +335,7 @@ class FilesController(BaseRepoController
 

	
 
        return render('files/files_add.html')
 

	
 
    @LoginRequired()
 
    @HasRepoPermissionAnyDecorator('repository.read', 'repository.write',
 
                                   'repository.admin')
 
    def archivefile(self, repo_name, fname):
 
@@ -387,6 +393,7 @@ class FilesController(BaseRepoController
 
        response.content_type = str(content_type)
 
        return get_chunked_archive(archive)
 

	
 
    @LoginRequired()
 
    @HasRepoPermissionAnyDecorator('repository.read', 'repository.write',
 
                                   'repository.admin')
 
    def diff(self, repo_name, f_path):
 
@@ -485,9 +492,10 @@ class FilesController(BaseRepoController
 

	
 
        return hist_l
 

	
 
    @jsonify
 
    @LoginRequired()
 
    @HasRepoPermissionAnyDecorator('repository.read', 'repository.write',
 
                                   'repository.admin')
 
    @jsonify
 
    def nodelist(self, repo_name, revision, f_path):
 
        if request.environ.get('HTTP_X_PARTIAL_XHR'):
 
            cs = self.__get_cs_or_redirect(revision, repo_name)
0 comments (0 inline, 0 general)