summaryrefslogtreecommitdiffstats
path: root/extensions/PhabBugz/lib
diff options
context:
space:
mode:
authordklawren <dklawren@users.noreply.github.com>2018-06-08 17:22:56 +0200
committerGitHub <noreply@github.com>2018-06-08 17:22:56 +0200
commit9af546bb69ad8d0d61d7575b284c28825a0056fe (patch)
treed2b271e59c2fa73780db67ee306c637806722e2d /extensions/PhabBugz/lib
parent4413e39bdec98460efc9851f243d4555b9d24e26 (diff)
downloadbugzilla-9af546bb69ad8d0d61d7575b284c28825a0056fe.tar.gz
bugzilla-9af546bb69ad8d0d61d7575b284c28825a0056fe.tar.xz
Bug 1467271 - When making a revision public, make the revision editable only by the bmo-editbugs-team project (editbugs)
Diffstat (limited to 'extensions/PhabBugz/lib')
-rw-r--r--extensions/PhabBugz/lib/Feed.pm13
1 files changed, 10 insertions, 3 deletions
diff --git a/extensions/PhabBugz/lib/Feed.pm b/extensions/PhabBugz/lib/Feed.pm
index b58c1ea4b..981c95fb3 100644
--- a/extensions/PhabBugz/lib/Feed.pm
+++ b/extensions/PhabBugz/lib/Feed.pm
@@ -337,13 +337,20 @@ sub process_revision_change {
blessed $revision_phid
? $revision_phid
: Bugzilla::Extension::PhabBugz::Revision->new_from_query({ phids => [ $revision_phid ] });
-
+
+ # Project tags/groups that will be used later for policies, etc.
my $secure_revision =
Bugzilla::Extension::PhabBugz::Project->new_from_query(
{
name => 'secure-revision'
}
);
+ my $edit_bugs =
+ Bugzilla::Extension::PhabBugz::Project->new_from_query(
+ {
+ name => 'bmo-editbugs-team'
+ }
+ );
# NO BUG ID
@@ -352,7 +359,7 @@ sub process_revision_change {
# If new revision and bug id was omitted, make revision public
INFO("No bug associated with new revision. Marking public.");
$revision->set_policy('view', 'public');
- $revision->set_policy('edit', 'users');
+ $revision->set_policy('edit', ($edit_bugs ? $edit_bugs->phid : 'users'));
$revision->remove_project($secure_revision->phid);
$revision->update();
INFO("SUCCESS");
@@ -382,7 +389,7 @@ sub process_revision_change {
if (!@{ $bug->groups_in }) {
INFO('Bug is public so setting view/edit public');
$revision->set_policy('view', 'public');
- $revision->set_policy('edit', 'users');
+ $revision->set_policy('edit', ($edit_bugs ? $edit_bugs->phid : 'users'));
$revision->remove_project($secure_revision->phid);
}
# else bug is private.