Permalink
Browse files

[api] fix branching of packages via project links

  • Loading branch information...
1 parent f2a4e4f commit 9c463b36960aedcaa9ef94ce3f2effba2b9fc586 @adrianschroeter adrianschroeter committed Oct 1, 2010
Showing with 5 additions and 2 deletions.
  1. +5 −2 src/api/app/controllers/source_controller.rb
View
7 src/api/app/controllers/source_controller.rb
@@ -247,13 +247,16 @@ def index_package
return
end
- if pkg.nil?
+ if ['branch'].include?(cmd)
+ dispatch_command
+ return
+ elsif pkg.nil?
unless @http_user.can_modify_project?(prj)
render_error :status => 403, :errorcode => "cmd_execution_no_permission",
:message => "no permission to execute command '#{cmd}' for not existing package"
return
end
- elsif not ['diff', 'branch'].include?(cmd) and not @http_user.can_modify_package?(pkg)
+ elsif not ['diff'].include?(cmd) and not @http_user.can_modify_package?(pkg)
render_error :status => 403, :errorcode => "cmd_execution_no_permission",
:message => "no permission to execute command '#{cmd}'"
return

0 comments on commit 9c463b3

Please sign in to comment.