diff options
author | dklawren <dklawren@users.noreply.github.com> | 2018-08-06 18:26:18 +0200 |
---|---|---|
committer | Dylan William Hardison <dylan@hardison.net> | 2018-08-06 18:26:18 +0200 |
commit | 9bd1e5b9cfefa9006eeb6bcd65a6671be7b23c99 (patch) | |
tree | 1af101927a935390042950bdfa6cb6fae63f5d09 /extensions/PhabBugz | |
parent | 520ce5b4cd66ebb6c66fdecd7e66750c9bc8f00c (diff) | |
download | bugzilla-9bd1e5b9cfefa9006eeb6bcd65a6671be7b23c99.tar.gz bugzilla-9bd1e5b9cfefa9006eeb6bcd65a6671be7b23c99.tar.xz |
Bug 1480897 - When making a revision public, make the revision editable only by the bmo-editbugs-team project (editbugs)
Diffstat (limited to 'extensions/PhabBugz')
-rw-r--r-- | extensions/PhabBugz/lib/Revision.pm | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/extensions/PhabBugz/lib/Revision.pm b/extensions/PhabBugz/lib/Revision.pm index 4e82fa500..d2df62e27 100644 --- a/extensions/PhabBugz/lib/Revision.pm +++ b/extensions/PhabBugz/lib/Revision.pm @@ -478,8 +478,14 @@ sub make_private { sub make_public { my ( $self ) = @_; - $self->set_policy('view', 'public'); - $self->set_policy('edit', 'users'); + my $editbugs = Bugzilla::Extension::PhabBugz::Project->new_from_query( + { + name => 'bmo-editbugs-team' + } + ); + + $self->set_policy( 'view', 'public' ); + $self->set_policy( 'edit', ( $editbugs ? $editbugs->phid : 'users' ) ); my @current_group_projects = grep { $_->name =~ /^(bmo-.*|secure-revision)$/ } @{ $self->projects }; foreach my $project (@current_group_projects) { |