summaryrefslogtreecommitdiffstats
path: root/app/views/users/show.api.rsb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2012-06-03 10:40:32 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2012-06-03 10:40:32 +0000
commitdd9c2cafa795ec00875981dcedd3287d2d005457 (patch)
tree4d540a76dc06fb4d530bb5804d3676fa366489d7 /app/views/users/show.api.rsb
parent3142183b3052b520126645eaec01526810e2afff (diff)
downloadredmine-dd9c2cafa795ec00875981dcedd3287d2d005457.tar.gz
redmine-dd9c2cafa795ec00875981dcedd3287d2d005457.zip
REST Api for Groups (#8981).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9758 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/views/users/show.api.rsb')
-rw-r--r--app/views/users/show.api.rsb6
1 files changed, 6 insertions, 0 deletions
diff --git a/app/views/users/show.api.rsb b/app/views/users/show.api.rsb
index b7d23ca97..ec7e5030f 100644
--- a/app/views/users/show.api.rsb
+++ b/app/views/users/show.api.rsb
@@ -9,6 +9,12 @@ api.user do
render_api_custom_values @user.visible_custom_field_values, api
+ api.array :groups do |groups|
+ @user.groups.each do |group|
+ api.group :id => group.id, :name => group.name
+ end
+ end if User.current.admin? && include_in_api_response?('groups')
+
api.array :memberships do
@memberships.each do |membership|
api.membership do