29 lines
984 B
Plaintext
29 lines
984 B
Plaintext
api.user do
|
|
api.id @user.id
|
|
api.login @user.login if User.current.admin?
|
|
api.firstname @user.firstname
|
|
api.lastname @user.lastname
|
|
api.mail @user.mail if User.current.admin? || !@user.pref.hide_mail
|
|
api.created_on @user.created_on
|
|
api.last_login_on @user.last_login_on
|
|
|
|
api.array :custom_fields do
|
|
@user.visible_custom_field_values.each do |custom_value|
|
|
api.custom_field custom_value.value, :id => custom_value.custom_field_id, :name => custom_value.custom_field.name
|
|
end
|
|
end unless @user.visible_custom_field_values.empty?
|
|
|
|
api.array :memberships do
|
|
@memberships.each do |membership|
|
|
api.membership do
|
|
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
|
|
end
|
|
end
|
|
end if membership.project
|
|
end
|
|
end if @memberships.present?
|
|
end
|