summaryrefslogtreecommitdiff
path: root/app/controllers/graph_controller.rb
diff options
context:
space:
mode:
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