ChangeControl visibility takes draft into account
isVisible() in ChangeControl now considers whether or not the change is a draft. As ReviewDb is needed to see whether or not a user has visibility for a certain change, this change also refactors most uses of isVisible() to also pass in ReviewDb. As a bonus, much of the notification routines seem to work as wanted, due to the new visibility checks. Change-Id: I4c3b068413e4db30edb23f498f61048142cb6713
This commit is contained in:
@@ -260,11 +260,13 @@ public class SetReviewersCommand extends BaseCommand {
|
||||
try {
|
||||
if (change != null
|
||||
&& inProject(change)
|
||||
&& changeControlFactory.controlFor(change).isVisible()) {
|
||||
&& changeControlFactory.controlFor(change).isVisible(db)) {
|
||||
matched.add(change.getId());
|
||||
}
|
||||
} catch (NoSuchChangeException e) {
|
||||
// Ignore this change.
|
||||
} catch (OrmException e) {
|
||||
log.warn("Error reading change " + change.getId(), e);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user