summaryrefslogtreecommitdiff
path: root/app/Model/ProjectPermission.php
diff options
context:
space:
mode:
Diffstat (limited to 'app/Model/ProjectPermission.php')
-rw-r--r--app/Model/ProjectPermission.php7
1 files changed, 6 insertions, 1 deletions
diff --git a/app/Model/ProjectPermission.php b/app/Model/ProjectPermission.php
index faa4ba29..c890a94f 100644
--- a/app/Model/ProjectPermission.php
+++ b/app/Model/ProjectPermission.php
@@ -27,12 +27,17 @@ class ProjectPermission extends Base
* @param integer $project_id Project id
* @param bool $prepend_unassigned Prepend the 'Unassigned' value
* @param bool $prepend_everybody Prepend the 'Everbody' value
+ * @param bool $allow_single_user If there is only one user return only this user
* @return array
*/
- public function getMemberList($project_id, $prepend_unassigned = true, $prepend_everybody = false)
+ public function getMemberList($project_id, $prepend_unassigned = true, $prepend_everybody = false, $allow_single_user = false)
{
$allowed_users = $this->getMembers($project_id);
+ if ($allow_single_user && count($allowed_users) === 1) {
+ return $allowed_users;
+ }
+
if ($prepend_unassigned) {
$allowed_users = array(t('Unassigned')) + $allowed_users;
}