Added the emailReviewers as a global capability
This adds functionality to deny the emailing of reviewers to certain groups. This will replace the emailOnlyAuthors flag on the AccountGroup. Change-Id: If3697e88df50e0b0256b5b6a1ea810343124b96f
This commit is contained in:
@@ -70,12 +70,17 @@ public abstract class ChangeEmail extends OutgoingEmail {
|
||||
|
||||
/** Is the from user in an email squelching group? */
|
||||
final IdentifiedUser user = args.identifiedUserFactory.create(id);
|
||||
final Set<AccountGroup.UUID> gids = user.getEffectiveGroups().getKnownGroups();
|
||||
for (final AccountGroup.UUID gid : gids) {
|
||||
AccountGroup group = args.groupCache.get(gid);
|
||||
if (group != null && group.isEmailOnlyAuthors()) {
|
||||
emailOnlyAuthors = true;
|
||||
break;
|
||||
if (!user.getCapabilities().canEmailReviewers()) {
|
||||
emailOnlyAuthors = true;
|
||||
} else {
|
||||
// TODO(cranger): remove once the schema is migrated in the next patch.
|
||||
final Set<AccountGroup.UUID> gids = user.getEffectiveGroups().getKnownGroups();
|
||||
for (final AccountGroup.UUID gid : gids) {
|
||||
AccountGroup group = args.groupCache.get(gid);
|
||||
if (group != null && group.isEmailOnlyAuthors()) {
|
||||
emailOnlyAuthors = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user