summaryrefslogtreecommitdiffstats
path: root/extensions/Push/lib
diff options
context:
space:
mode:
authordklawren <dklawren@users.noreply.github.com>2018-06-25 23:26:53 +0200
committerGitHub <noreply@github.com>2018-06-25 23:26:53 +0200
commite83b95790d29393e9711aedeccfd63353bbc3cde (patch)
tree2a447ad3477572babc418f42e709717cdfeb001f /extensions/Push/lib
parentf8a6f476946b994f7f555da0ebbb14fc57a4f9c4 (diff)
downloadbugzilla-e83b95790d29393e9711aedeccfd63353bbc3cde.tar.gz
bugzilla-e83b95790d29393e9711aedeccfd63353bbc3cde.tar.xz
Bug 1457900 - When restricting a revision to a bugzilla group we should tag the revision with the project
Diffstat (limited to 'extensions/Push/lib')
-rw-r--r--extensions/Push/lib/Connector/Phabricator.pm19
1 files changed, 4 insertions, 15 deletions
diff --git a/extensions/Push/lib/Connector/Phabricator.pm b/extensions/Push/lib/Connector/Phabricator.pm
index aeef32ab4..5d5e4e639 100644
--- a/extensions/Push/lib/Connector/Phabricator.pm
+++ b/extensions/Push/lib/Connector/Phabricator.pm
@@ -78,19 +78,13 @@ sub send {
: 0;
foreach my $revision (@$revisions) {
- my $secure_revision = Bugzilla::Extension::PhabBugz::Project->new_from_query({
- name => 'secure-revision'
- });
-
if ( $is_public && $group_change ) {
Bugzilla->audit(sprintf(
'Making revision %s public for bug %s',
$revision->id,
$bug->id
));
- $revision->set_policy('view', 'public');
- $revision->set_policy('edit', 'users');
- $revision->remove_project($secure_revision->phid);
+ $revision->make_public();
}
elsif ( !$is_public && !@set_groups ) {
Bugzilla->audit(sprintf(
@@ -99,9 +93,7 @@ sub send {
$bug->id,
join(', ', @set_groups)
));
- $revision->set_policy('view', $secure_revision->phid);
- $revision->set_policy('edit', $secure_revision->phid);
- $revision->add_project($secure_revision->phid);
+ $revision->make_private(['secure-revision']);
add_security_sync_comments([$revision], $bug);
}
elsif ( !$is_public && $group_change ) {
@@ -110,11 +102,8 @@ sub send {
$revision->id,
$bug->id
));
- my @set_projects = map { "bmo-" . $_ } @set_groups;
- my $new_policy = Bugzilla::Extension::PhabBugz::Policy->create(\@set_projects);
- $revision->set_policy('view', $new_policy->phid);
- $revision->set_policy('edit', $new_policy->phid);
- $revision->add_project($secure_revision->phid);
+ my @set_project_names = map { "bmo-" . $_ } @set_groups;
+ $revision->make_private(\@set_project_names);
}
# Subscriber list of the private revision should always match