summaryrefslogtreecommitdiff
path: root/app/controllers/graph_controller.rb
diff options
context:
space:
mode:
authorSebastian Ziebell <sebastian.ziebell@asquera.de>2013-02-08 10:32:42 +0100
committerSebastian Ziebell <sebastian.ziebell@asquera.de>2013-02-08 10:32:42 +0100
commit8045a81bcf5822f1992442750e1484a93c368229 (patch)
tree94ce2b257f3ba002ac1a0fde70b69b622304810d /app/controllers/graph_controller.rb
parent5d8a99f10429168e6471fdd1843f5045a10a84b3 (diff)
parent2f0a75ab77af430f682d67aa9bb865007d832795 (diff)
downloadgitlab-ce-8045a81bcf5822f1992442750e1484a93c368229.tar.gz
Merge branch 'master' into fixes/api
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