diff --git a/module/doc/js/common.js b/module/doc/js/common.js index 3f8cd7c122..2f095250d7 100644 --- a/module/doc/js/common.js +++ b/module/doc/js/common.js @@ -24,11 +24,18 @@ function toggleAcl(acl, type) if(acl == 'custom') { $('#whiteListBox').removeClass('hidden'); + $('#groupWhiteListBox').removeClass('hidden'); + } + else if(acl == 'private') + { + $('#whiteListBox').removeClass('hidden'); + $('#groupWhiteListBox').addClass('hidden'); } else { $('#whiteListBox').addClass('hidden'); } + if(type == 'lib') { var libType = $('input[name="type"]:checked').val(); diff --git a/module/doc/model.php b/module/doc/model.php index 69845ddc09..aa5bbd7e31 100644 --- a/module/doc/model.php +++ b/module/doc/model.php @@ -177,8 +177,7 @@ class docModel extends model $lib->project = $execution->project; } - if($lib->acl == 'private') $lib->users = $this->app->user->account; - if($lib->acl == 'custom') + if($lib->acl == 'custom' or $lib->acl == 'private') { $trimedUsers = ',' . trim($lib->users, ',') . ','; if(strpos($trimedUsers, ',' . $this->app->user->account . ',') === false) $lib->users .= ',' . $this->app->user->account; @@ -911,6 +910,7 @@ class docModel extends model $project = $this->loadModel('project')->getById($object->project); $projectTeams = $this->loadModel('user')->getTeamMemberPairs($object->project); $authorizedUsers = $this->user->getProjectAuthedUsers($project, '', $projectTeams, array_flip(explode(",", $project->whitelist))); + if(strpos(",{$object->users},", $account) !== false) return true; if(array_key_exists($this->app->user->account, array_filter($authorizedUsers))) return true; } diff --git a/module/doc/view/createlib.html.php b/module/doc/view/createlib.html.php index e4c5a850ef..0bce51f4cf 100644 --- a/module/doc/view/createlib.html.php +++ b/module/doc/view/createlib.html.php @@ -59,7 +59,7 @@