summaryrefslogtreecommitdiff
path: root/app/controllers/graph_controller.rb
diff options
context:
space:
mode:
authorSato Hiroyuki <sathiroyuki@gmail.com>2013-01-29 17:25:17 +0900
committerSato Hiroyuki <sathiroyuki@gmail.com>2013-01-30 09:12:03 +0900
commit525a8cd3e96b7bae0acda8b6e94df529fa06ff6a (patch)
treedbfda7c6ee03274470c2176c7c19dc396fc4ac5a /app/controllers/graph_controller.rb
parentc84675ee06dfc72c46c178ef40e30f03053dcc5a (diff)
downloadgitlab-ce-525a8cd3e96b7bae0acda8b6e94df529fa06ff6a.tar.gz
Switchable the main branch on network graph
Diffstat (limited to 'app/controllers/graph_controller.rb')
-rw-r--r--app/controllers/graph_controller.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/app/controllers/graph_controller.rb b/app/controllers/graph_controller.rb
new file mode 100644
index 00000000000..30ec5e89db2
--- /dev/null
+++ b/app/controllers/graph_controller.rb
@@ -0,0 +1,18 @@
+class GraphController < ProjectResourceController
+ include ExtractsPath
+
+ # Authorize
+ before_filter :authorize_read_project!
+ before_filter :authorize_code_access!
+ before_filter :require_non_empty_project
+
+ def show
+ respond_to do |format|
+ format.html
+ format.json do
+ graph = Gitlab::Graph::JsonBuilder.new(project, @ref)
+ render :json => graph.to_json
+ end
+ end
+ end
+end