Skip to content

Commit

Permalink
Merge pull request #110 from eiriksm/feat/assignee-based-on-roles
Browse files Browse the repository at this point in the history
Only allow assignees if the role is correct
  • Loading branch information
eiriksm committed May 1, 2019
2 parents 138a7b0 + b79c789 commit fa14c75
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion src/CosyComposer.php
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,6 @@ class CosyComposer
*/
protected $project;


/**
* @var \Http\Adapter\Guzzle6\Client
*/
Expand Down Expand Up @@ -890,6 +889,21 @@ public function run()
$assignees = $cdata->extra->violinist->assignees;
}
}
$assignees_allowed_roles = [
'agency',
'enterprise',
];
$assignees_allowed = false;
if ($this->project && $this->project->getRoles()) {
foreach ($this->project->getRoles() as $role) {
if (in_array($role, $assignees_allowed_roles)) {
$assignees_allowed = true;
}
}
}
if (!$assignees_allowed) {
$assignees = [];
}
$pr_params = [
'base' => $default_branch,
'head' => $head,
Expand Down

0 comments on commit fa14c75

Please sign in to comment.