aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@gmail.com>2012-10-11 18:20:51 +0200
committerSimon Brandhof <simon.brandhof@gmail.com>2012-10-11 18:21:05 +0200
commit39f7926a779b8e554f251c11597ea3918bbff134 (patch)
treedaac85c26c7157ac6a394ea9ea079c2de76ec137
parentdda58b70cd2dfd0fb9af1925e7d2a871042cf8a2 (diff)
downloadsonarqube-39f7926a779b8e554f251c11597ea3918bbff134.tar.gz
sonarqube-39f7926a779b8e554f251c11597ea3918bbff134.zip
Add some doc + fix /api/profiles/list when no language is provided
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/controllers/api/authentication_controller.rb1
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/controllers/api/profiles_controller.rb6
2 files changed, 6 insertions, 1 deletions
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/controllers/api/authentication_controller.rb b/sonar-server/src/main/webapp/WEB-INF/app/controllers/api/authentication_controller.rb
index 5554c8f4728..f2eb6f88b71 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/controllers/api/authentication_controller.rb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/controllers/api/authentication_controller.rb
@@ -27,6 +27,7 @@ class Api::AuthenticationController < Api::ApiController
# GET /api/authentication/validate
# curl http://localhost:9000/api/authentication/validate -v -u admin:admin
#
+ # Since v.3.3
def validate
hash={:valid => valid?}
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/controllers/api/profiles_controller.rb b/sonar-server/src/main/webapp/WEB-INF/app/controllers/api/profiles_controller.rb
index 906a2445768..659ecfb0f71 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/controllers/api/profiles_controller.rb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/controllers/api/profiles_controller.rb
@@ -23,6 +23,8 @@ class Api::ProfilesController < Api::ApiController
# GET /api/profiles/list?[language=<language][&project=<project id or key>]
#
+ # Since v.3.3
+ #
# ==== Examples
# - get all the profiles : GET /api/profiles/list
# - get all the Java profiles : GET /api/profiles/list?language=java
@@ -38,7 +40,7 @@ class Api::ProfilesController < Api::ApiController
if language.present?
profiles=[Profile.by_project_id(language, project.id, true)]
else
- profiles=Api::Utils.languages.map { |lang| Profile.by_project_id(lang, project.id, true) }
+ profiles=Api::Utils.languages.map { |lang| Profile.by_project_id(lang.getKey(), project.id, true) }
end
elsif language.present?
profiles=Profile.all_by_language(language)
@@ -69,6 +71,8 @@ class Api::ProfilesController < Api::ApiController
end
# POST /api/profiles/set_as_default?language=<language>&name=<name>
+ #
+ # Since v.3.3
def set_as_default
verify_post_request
access_denied unless has_role?(:admin)