diff --git a/module/project/model.php b/module/project/model.php index b5d90b1f05..27fd8ce7cd 100644 --- a/module/project/model.php +++ b/module/project/model.php @@ -1,6 +1,22 @@ app->user->admin) return true; + return (strpos(",{$this->app->user->view->projects},", ",{$projectID},") !== false); + } + /** * Get Multiple linked products for project. * diff --git a/module/release/model.php b/module/release/model.php index 2f08f19efc..90f4b12acc 100644 --- a/module/release/model.php +++ b/module/release/model.php @@ -66,7 +66,7 @@ class releaseModel extends model ->page($pager) ->fetchAll(); - $builds = $this->dao->select("t1.id, t1.name, t1.execution, IF(t2.name IS NOT NULL, t2.name, '') AS projectName, IF(t3.name IS NOT NULL, t3.name, '{$this->lang->trunk}') AS branchName") + $builds = $this->dao->select("t1.id, t1.name, t1.project, t1.execution, IF(t2.name IS NOT NULL, t2.name, '') AS projectName, IF(t3.name IS NOT NULL, t3.name, '{$this->lang->trunk}') AS branchName") ->from(TABLE_BUILD)->alias('t1') ->leftJoin(TABLE_PROJECT)->alias('t2')->on('t1.project = t2.id') ->leftJoin(TABLE_BRANCH)->alias('t3')->on('t1.branch = t3.id') diff --git a/module/release/view/browse.html.php b/module/release/view/browse.html.php index c6f0049c4e..86a23ef7bd 100644 --- a/module/release/view/browse.html.php +++ b/module/release/view/browse.html.php @@ -63,6 +63,10 @@
+ loadModel('project'); + $this->loadModel('execution'); + ?> builds);?> @@ -82,7 +86,13 @@ type != 'normal'):?> branchName;?> - createLink($build->execution ? 'build' : 'projectbuild', 'view', "buildID=$build->id"), $build->name);?> + execution ? 'build' : 'projectbuild'; + $canClickable = false; + if($moduleName == 'projectbuild' and $this->project->checkPriv($build->project)) $canClickable = true; + if($moduleName == 'build' and $this->execution->checkPriv($build->execution)) $canClickable = true; + echo $canClickable ? html::a($this->createLink($moduleName, 'view', "buildID=$build->id"), $build->name, '', "data-app='project'") : $build->name; + ?>