Skip to content

Commit b807e73

Browse files
VBeytokMykolaiKorniat
authored andcommitted
Update Projects.php
Add min_access_level for accessible
1 parent 3a4f719 commit b807e73

File tree

1 file changed

+20
-9
lines changed

1 file changed

+20
-9
lines changed

lib/Gitlab/Api/Projects.php

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
class Projects extends AbstractApi
44
{
5+
const GUEST_ACCESS_LEVEL = 10;
56
const ORDER_BY = 'created_at';
67
const SORT = 'asc';
78

@@ -25,18 +26,28 @@ public function all($page = 1, $per_page = self::PER_PAGE, $order_by = self::ORD
2526
/**
2627
* @param int $page
2728
* @param int $per_page
29+
* @param int $min_access_level
2830
* @param string $order_by
2931
* @param string $sort
3032
* @return mixed
3133
*/
32-
public function accessible($page = 1, $per_page = self::PER_PAGE, $order_by = self::ORDER_BY, $sort = self::SORT)
33-
{
34-
return $this->get('projects?membership=true', array(
35-
'page' => $page,
36-
'per_page' => $per_page,
37-
'order_by' => $order_by,
38-
'sort' => $sort
39-
));
34+
public function accessible(
35+
$page = 1,
36+
$per_page = self::PER_PAGE,
37+
$min_access_level = self::GUEST_ACCESS_LEVEL,
38+
$order_by = self::ORDER_BY,
39+
$sort = self::SORT
40+
) {
41+
return $this->get(
42+
'projects?membership=true',
43+
array(
44+
'page' => $page,
45+
'per_page' => $per_page,
46+
'min_access_level' => $min_access_level,
47+
'order_by' => $order_by,
48+
'sort' => $sort
49+
)
50+
);
4051
}
4152

4253
/**
@@ -529,4 +540,4 @@ public function uploadFile($project_id, $file)
529540
{
530541
return $this->post($this->getProjectPath($project_id, 'uploads'), array(), array(), array('file' => $file));
531542
}
532-
}
543+
}

0 commit comments

Comments
 (0)