Skip to content

Commit 5ade19f

Browse files
authored
Merge pull request KnpLabs#388 from chaseconey/add-repository-with-permissions
Allow Adding Repo With Permissions
2 parents da5451d + 6e96cf6 commit 5ade19f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/Github/Api/Organization/Teams.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,12 @@ public function repository($team, $username, $repository)
8383
return $this->get('teams/'.rawurlencode($team).'/repos/'.rawurlencode($username).'/'.rawurlencode($repository));
8484
}
8585

86-
public function addRepository($team, $username, $repository)
86+
public function addRepository($team, $username, $repository, $params = array())
8787
{
88+
if (isset($params['permission']) && !in_array($params['permission'], array('pull', 'push', 'admin'))) {
89+
$params['permission'] = 'pull';
90+
}
91+
8892
return $this->put('teams/'.rawurlencode($team).'/repos/'.rawurlencode($username).'/'.rawurlencode($repository));
8993
}
9094

0 commit comments

Comments
 (0)