##// END OF EJS Templates
moved login required into seperate calls for files due to optional API access option...
marcink -
r2457:01e005ca beta
parent child Browse files
Show More
@@ -61,7 +61,7 b' log = logging.getLogger(__name__)'
61
61
62 class FilesController(BaseRepoController):
62 class FilesController(BaseRepoController):
63
63
64 @LoginRequired()
64
65 def __before__(self):
65 def __before__(self):
66 super(FilesController, self).__before__()
66 super(FilesController, self).__before__()
67 c.cut_off_limit = self.cut_off_limit
67 c.cut_off_limit = self.cut_off_limit
@@ -113,6 +113,7 b' class FilesController(BaseRepoController'
113
113
114 return file_node
114 return file_node
115
115
116 @LoginRequired()
116 @HasRepoPermissionAnyDecorator('repository.read', 'repository.write',
117 @HasRepoPermissionAnyDecorator('repository.read', 'repository.write',
117 'repository.admin')
118 'repository.admin')
118 def index(self, repo_name, revision, f_path, annotate=False):
119 def index(self, repo_name, revision, f_path, annotate=False):
@@ -169,6 +170,7 b' class FilesController(BaseRepoController'
169
170
170 return render('files/files.html')
171 return render('files/files.html')
171
172
173 @LoginRequired()
172 @HasRepoPermissionAnyDecorator('repository.read', 'repository.write',
174 @HasRepoPermissionAnyDecorator('repository.read', 'repository.write',
173 'repository.admin')
175 'repository.admin')
174 def rawfile(self, repo_name, revision, f_path):
176 def rawfile(self, repo_name, revision, f_path):
@@ -180,7 +182,8 b' class FilesController(BaseRepoController'
180
182
181 response.content_type = file_node.mimetype
183 response.content_type = file_node.mimetype
182 return file_node.content
184 return file_node.content
183
185
186 @LoginRequired()
184 @HasRepoPermissionAnyDecorator('repository.read', 'repository.write',
187 @HasRepoPermissionAnyDecorator('repository.read', 'repository.write',
185 'repository.admin')
188 'repository.admin')
186 def raw(self, repo_name, revision, f_path):
189 def raw(self, repo_name, revision, f_path):
@@ -227,6 +230,7 b' class FilesController(BaseRepoController'
227 response.content_type = mimetype
230 response.content_type = mimetype
228 return file_node.content
231 return file_node.content
229
232
233 @LoginRequired()
230 @HasRepoPermissionAnyDecorator('repository.write', 'repository.admin')
234 @HasRepoPermissionAnyDecorator('repository.write', 'repository.admin')
231 def edit(self, repo_name, revision, f_path):
235 def edit(self, repo_name, revision, f_path):
232 r_post = request.POST
236 r_post = request.POST
@@ -276,6 +280,7 b' class FilesController(BaseRepoController'
276
280
277 return render('files/files_edit.html')
281 return render('files/files_edit.html')
278
282
283 @LoginRequired()
279 @HasRepoPermissionAnyDecorator('repository.write', 'repository.admin')
284 @HasRepoPermissionAnyDecorator('repository.write', 'repository.admin')
280 def add(self, repo_name, revision, f_path):
285 def add(self, repo_name, revision, f_path):
281 r_post = request.POST
286 r_post = request.POST
@@ -330,6 +335,7 b' class FilesController(BaseRepoController'
330
335
331 return render('files/files_add.html')
336 return render('files/files_add.html')
332
337
338 @LoginRequired()
333 @HasRepoPermissionAnyDecorator('repository.read', 'repository.write',
339 @HasRepoPermissionAnyDecorator('repository.read', 'repository.write',
334 'repository.admin')
340 'repository.admin')
335 def archivefile(self, repo_name, fname):
341 def archivefile(self, repo_name, fname):
@@ -387,6 +393,7 b' class FilesController(BaseRepoController'
387 response.content_type = str(content_type)
393 response.content_type = str(content_type)
388 return get_chunked_archive(archive)
394 return get_chunked_archive(archive)
389
395
396 @LoginRequired()
390 @HasRepoPermissionAnyDecorator('repository.read', 'repository.write',
397 @HasRepoPermissionAnyDecorator('repository.read', 'repository.write',
391 'repository.admin')
398 'repository.admin')
392 def diff(self, repo_name, f_path):
399 def diff(self, repo_name, f_path):
@@ -485,9 +492,10 b' class FilesController(BaseRepoController'
485
492
486 return hist_l
493 return hist_l
487
494
488 @jsonify
495 @LoginRequired()
489 @HasRepoPermissionAnyDecorator('repository.read', 'repository.write',
496 @HasRepoPermissionAnyDecorator('repository.read', 'repository.write',
490 'repository.admin')
497 'repository.admin')
498 @jsonify
491 def nodelist(self, repo_name, revision, f_path):
499 def nodelist(self, repo_name, revision, f_path):
492 if request.environ.get('HTTP_X_PARTIAL_XHR'):
500 if request.environ.get('HTTP_X_PARTIAL_XHR'):
493 cs = self.__get_cs_or_redirect(revision, repo_name)
501 cs = self.__get_cs_or_redirect(revision, repo_name)
General Comments 0
You need to be logged in to leave comments. Login now