Merge branch 'stable-2.11'
* stable-2.11: Fix non-ascii password authentication failure under tomcat (LDAP) Allow InternalUsers to see drafts Change-Id: Ic81a825c8063b8e1e272f6d25d4a2730b3ee9058
This commit is contained in:
commit
5bc2e1c115
@ -14,6 +14,8 @@
|
||||
|
||||
package com.google.gerrit.httpd.auth.ldap;
|
||||
|
||||
import static java.nio.charset.StandardCharsets.UTF_8;
|
||||
|
||||
import com.google.common.base.MoreObjects;
|
||||
import com.google.common.base.Strings;
|
||||
import com.google.gerrit.common.Nullable;
|
||||
@ -106,6 +108,7 @@ class LdapLoginServlet extends HttpServlet {
|
||||
@Override
|
||||
protected void doPost(HttpServletRequest req, HttpServletResponse res)
|
||||
throws ServletException, IOException {
|
||||
req.setCharacterEncoding(UTF_8.name());
|
||||
String username = Strings.nullToEmpty(req.getParameter("username")).trim();
|
||||
String password = Strings.nullToEmpty(req.getParameter("password"));
|
||||
String remember = Strings.nullToEmpty(req.getParameter("rememberme"));
|
||||
|
@ -100,4 +100,9 @@ public abstract class CurrentUser {
|
||||
public boolean isIdentifiedUser() {
|
||||
return false;
|
||||
}
|
||||
|
||||
/** Check if the CurrentUser is an InternalUser. */
|
||||
public boolean isInternalUser() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -61,6 +61,11 @@ public class InternalUser extends CurrentUser {
|
||||
return Collections.emptySet();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isInternalUser() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "InternalUser";
|
||||
|
@ -28,6 +28,7 @@ import com.google.gerrit.reviewdb.client.Project;
|
||||
import com.google.gerrit.reviewdb.server.ReviewDb;
|
||||
import com.google.gerrit.server.CurrentUser;
|
||||
import com.google.gerrit.server.IdentifiedUser;
|
||||
import com.google.gerrit.server.InternalUser;
|
||||
import com.google.gerrit.server.notedb.ChangeNotes;
|
||||
import com.google.gerrit.server.query.change.ChangeData;
|
||||
import com.google.gwtorm.server.OrmException;
|
||||
@ -352,6 +353,7 @@ public class ChangeControl {
|
||||
|
||||
public boolean isDraftVisible(ReviewDb db, ChangeData cd)
|
||||
throws OrmException {
|
||||
return isOwner() || isReviewer(db, cd) || getRefControl().canViewDrafts();
|
||||
return isOwner() || isReviewer(db, cd) || getRefControl().canViewDrafts()
|
||||
|| getCurrentUser().isInternalUser();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user