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:
@@ -401,11 +401,11 @@ public abstract class ChangeEmail extends OutgoingEmail {
|
||||
}
|
||||
}
|
||||
|
||||
protected boolean isVisibleTo(final Account.Id to) {
|
||||
protected boolean isVisibleTo(final Account.Id to) throws OrmException {
|
||||
return projectState == null
|
||||
|| change == null
|
||||
|| projectState.controlFor(args.identifiedUserFactory.create(to))
|
||||
.controlFor(change).isVisible();
|
||||
.controlFor(change).isVisible(args.db.get());
|
||||
}
|
||||
|
||||
/** Find all users who are authors of any part of this change. */
|
||||
|
Reference in New Issue
Block a user