Merge "Allow InternalUsers to see drafts" into stable-2.11
This commit is contained in:
commit
70dbef29df
@ -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