summaryrefslogtreecommitdiffstats
path: root/app/views
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2012-02-06 16:32:50 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2012-02-06 16:32:50 +0000
commitcdcf813fa784f9e84f99e74dae8c30b8ef4494b8 (patch)
treed11ebd8a679839108481ba8896078a20a52f76cf /app/views
parentdfbab5d61ee7b106a715a353074053041312b9b0 (diff)
downloadredmine-cdcf813fa784f9e84f99e74dae8c30b8ef4494b8.tar.gz
redmine-cdcf813fa784f9e84f99e74dae8c30b8ef4494b8.zip
Adds membership ids to /users/:id API response.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8805 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/views')
-rw-r--r--app/views/users/show.api.rsb9
1 files changed, 7 insertions, 2 deletions
diff --git a/app/views/users/show.api.rsb b/app/views/users/show.api.rsb
index 26d8a998a..b7d23ca97 100644
--- a/app/views/users/show.api.rsb
+++ b/app/views/users/show.api.rsb
@@ -12,10 +12,15 @@ api.user do
api.array :memberships do
@memberships.each do |membership|
api.membership do
+ api.id membership.id
api.project :id => membership.project.id, :name => membership.project.name
api.array :roles do
- membership.roles.each do |role|
- api.role :id => role.id, :name => role.name
+ membership.member_roles.each do |member_role|
+ if member_role.role
+ attrs = {:id => member_role.role.id, :name => member_role.role.name}
+ attrs.merge!(:inherited => true) if member_role.inherited_from.present?
+ api.role attrs
+ end
end
end
end if membership.project