diff options
author | dklawren <dklawren@users.noreply.github.com> | 2018-06-08 17:22:56 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-06-08 17:22:56 +0200 |
commit | 9af546bb69ad8d0d61d7575b284c28825a0056fe (patch) | |
tree | d2b271e59c2fa73780db67ee306c637806722e2d | |
parent | 4413e39bdec98460efc9851f243d4555b9d24e26 (diff) | |
download | bugzilla-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)
-rw-r--r-- | extensions/PhabBugz/lib/Feed.pm | 13 |
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. |