diff options
author | dklawren <dklawren@users.noreply.github.com> | 2018-03-02 21:20:43 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-02 21:20:43 +0100 |
commit | 34b8e7eda7b6edddcf736dcd8f28dc9027391679 (patch) | |
tree | 4ab1d8a93bb94dbdc394eeda96e2686e8de5c98a /extensions/PhabBugz/lib/Util.pm | |
parent | 785a05910108a6d032e802605762d7567dec4123 (diff) | |
download | bugzilla-34b8e7eda7b6edddcf736dcd8f28dc9027391679.tar.gz bugzilla-34b8e7eda7b6edddcf736dcd8f28dc9027391679.tar.xz |
Bug 1402494 - BMO Integration User is a full administrative user on Phabricator
Diffstat (limited to 'extensions/PhabBugz/lib/Util.pm')
-rw-r--r-- | extensions/PhabBugz/lib/Util.pm | 32 |
1 files changed, 22 insertions, 10 deletions
diff --git a/extensions/PhabBugz/lib/Util.pm b/extensions/PhabBugz/lib/Util.pm index 5658ac9d8..6c51df98c 100644 --- a/extensions/PhabBugz/lib/Util.pm +++ b/extensions/PhabBugz/lib/Util.pm @@ -167,10 +167,13 @@ sub create_private_revision_policy { ); } else { + my $secure_revision = Bugzilla::Extension::PhabBugz::Project->new_from_query({ + name => 'secure-revision' + }); push(@{ $data->{policy} }, { action => 'allow', - value => 'admin', + value => $secure_revision->phid, } ); } @@ -198,15 +201,20 @@ sub make_revision_public { sub make_revision_private { my ($revision_phid) = @_; + + my $secure_revision = Bugzilla::Extension::PhabBugz::Project->new_from_query({ + name => 'secure-revision' + }); + return request('differential.revision.edit', { transactions => [ { type => "view", - value => "admin" + value => $secure_revision->phid }, { type => "edit", - value => "admin" + value => $secure_revision->phid } ], objectIdentifier => $revision_phid @@ -298,15 +306,19 @@ sub get_project_phid { sub create_project { my ($project, $description, $members) = @_; + my $secure_revision = Bugzilla::Extension::PhabBugz::Project->new_from_query({ + name => 'secure-revision' + }); + my $data = { transactions => [ - { type => 'name', value => $project }, - { type => 'description', value => $description }, - { type => 'edit', value => 'admin' }, - { type => 'join', value => 'admin' }, - { type => 'view', value => 'admin' }, - { type => 'icon', value => 'group' }, - { type => 'color', value => 'red' } + { type => 'name', value => $project }, + { type => 'description', value => $description }, + { type => 'edit', value => $secure_revision->phid }. + { type => 'join', value => $secure_revision->phid }, + { type => 'view', value => $secure_revision->phid }, + { type => 'icon', value => 'group' }, + { type => 'color', value => 'red' } ] }; |