GitLab steht Mittwoch, den 23. September, zwischen 10:00 und 12:00 Uhr aufgrund von Wartungsarbeiten nicht zur Verfügung.

Commit 72ff7a85 authored by maeda's avatar maeda

Display user logins on profiles (#26127).

Patch by Marius BALTEANU.


git-svn-id: https://svn.redmine.org/redmine/trunk@17721 e93f8b46-1217-0410-a6f0-8f06a7374b81
parent 19759d36
api.user do
api.id @user.id
api.login @user.login if User.current.admin? || (User.current == @user)
api.login @user.login
api.admin @user.admin? if User.current.admin? || (User.current == @user)
api.firstname @user.firstname
api.lastname @user.lastname
......@@ -29,7 +29,7 @@ api.user do
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
end if membership.project
......
......@@ -6,9 +6,7 @@
<div class="splitcontentleft">
<ul>
<% if User.current.admin? %>
<li><%=l(:field_login)%>: <%= @user.login %></li>
<% end %>
<li><%=l(:field_login)%>: <%= @user.login %></li>
<% unless @user.pref.hide_mail %>
<li><%=l(:field_mail)%>: <%= mail_to(@user.mail, nil, :encode => 'javascript') %></li>
<% end %>
......
......@@ -89,16 +89,10 @@ class Redmine::ApiTest::UsersTest < Redmine::ApiTest::Base
assert_select 'user id', :text => '2'
end
test "GET /users/:id should not return login for other user" do
test "GET /users/:id should return login for visible user" do
get '/users/3.xml', :headers => credentials('jsmith')
assert_response :success
assert_select 'user login', 0
end
test "GET /users/:id should return login for current user" do
get '/users/2.xml', :headers => credentials('jsmith')
assert_response :success
assert_select 'user login', :text => 'jsmith'
assert_select 'user login', :text => 'dlopper'
end
test "GET /users/:id should not return api_key for other user" do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment