summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJulien Lancelot <julien.lancelot@sonarsource.com>2013-12-06 09:00:12 +0100
committerJulien Lancelot <julien.lancelot@sonarsource.com>2013-12-06 09:00:12 +0100
commit2709684cca4a5f56e1e15c1de5ef5ad170ec8abf (patch)
tree41e5bc6f1a458fbc3a18b8bab266b937adceb902
parent451625c12e9d38b66faeebb26ddc31c44033d7e9 (diff)
downloadsonarqube-2709684cca4a5f56e1e15c1de5ef5ad170ec8abf.tar.gz
sonarqube-2709684cca4a5f56e1e15c1de5ef5ad170ec8abf.zip
SONAR-4827 Add WS to add and remove user / group template permission
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/controllers/permission_templates_controller.rb56
1 files changed, 52 insertions, 4 deletions
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/controllers/permission_templates_controller.rb b/sonar-server/src/main/webapp/WEB-INF/app/controllers/permission_templates_controller.rb
index fb206e85cf1..cdb547c9dc8 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/controllers/permission_templates_controller.rb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/controllers/permission_templates_controller.rb
@@ -67,6 +67,30 @@ class PermissionTemplatesController < ApplicationController
end
#
+ # POST
+ #
+ def add_user_permission
+ verify_post_request
+ require_parameters :template, :permission, :user
+
+ Internal.permission_templates.addUserPermission(params[:template], params[:permission], params[:user])
+ status = 200
+ render :status => status, :text => '{}'
+ end
+
+ #
+ # POST
+ #
+ def remove_user_permission
+ verify_post_request
+ require_parameters :template, :permission, :user
+
+ Internal.permission_templates.removeUserPermission(params[:template], params[:permission], params[:user])
+ status = 200
+ render :status => status, :text => '{}'
+ end
+
+ #
# GET /permission_templates/search_groups?permission=<permission>&template=<template key>selected=<selected>&page=3&pageSize=10&query=<query>
#
def search_groups
@@ -88,7 +112,31 @@ class PermissionTemplatesController < ApplicationController
end
#
- # GET (modal form)
+ # POST
+ #
+ def add_group_permission
+ verify_post_request
+ require_parameters :template, :permission, :group
+
+ Internal.permission_templates.addGroupPermission(params[:template], params[:permission], params[:group])
+ status = 200
+ render :status => status, :text => '{}'
+ end
+
+ #
+ # POST
+ #
+ def remove_group_permission
+ verify_post_request
+ require_parameters :template, :permission, :group
+
+ Internal.permission_templates.removeGroupPermission(params[:template], params[:permission], params[:group])
+ status = 200
+ render :status => status, :text => '{}'
+ end
+
+ #
+ # TODO delete it
#
def edit_users
@permission = params[:permission]
@@ -100,7 +148,7 @@ class PermissionTemplatesController < ApplicationController
end
#
- # GET (modal form)
+ # TODO delete it
#
def edit_groups
@permission = params[:permission]
@@ -112,7 +160,7 @@ class PermissionTemplatesController < ApplicationController
end
#
- # POST
+ # TODO delete it# POST
#
def update_users_permissions
verify_post_request
@@ -140,7 +188,7 @@ class PermissionTemplatesController < ApplicationController
end
#
- # POST
+ # TODO delete it
#
def update_groups_permissions
verify_post_request