* Adjust priv of devops.

This commit is contained in:
zhaoke
2023-09-11 16:35:18 +08:00
parent b9aa6c5a00
commit 6b90ec50d0
4 changed files with 13 additions and 2 deletions
+2 -1
View File
@@ -20,7 +20,8 @@ class gitea extends control
{
parent::__construct($moduleName, $methodName);
if(!commonModel::hasPriv('space', 'browse')) $this->loadModel('common')->deny('space', 'browse', false);
if(!commonModel::hasPriv('instance', 'manage')) $this->loadModel('common')->deny('instance', 'manage', false);
/* This is essential when changing tab(menu) from gitea to repo. */
/* Optional: common::setMenuVars('devops', $this->session->repoID); */
if($this->app->rawMethod != 'binduser') $this->loadModel('ci')->setMenu();
+5
View File
@@ -21,6 +21,11 @@ class gitlab extends control
parent::__construct($moduleName, $methodName);
if(!commonModel::hasPriv('space', 'browse')) $this->loadModel('common')->deny('space', 'browse', false);
if(!in_array($methodName, array('browseproject', 'browsegroup', 'managegroupmembers', 'browseuser', 'browsebranch', 'manageprojectmembers', 'managebranchpriv', 'managetagpriv', 'browsetag')))
{
if(!commonModel::hasPriv('instance', 'manage')) $this->loadModel('common')->deny('instance', 'manage', false);
}
/* This is essential when changing tab(menu) from gitlab to repo. */
/* Optional: common::setMenuVars('devops', $this->session->repoID); */
$this->loadModel('ci')->setMenu();
+1 -1
View File
@@ -20,7 +20,7 @@ class gogs extends control
{
parent::__construct($moduleName, $methodName);
if(!commonModel::hasPriv('space', 'browse')) $this->loadModel('common')->deny('space', 'browse', false);
if(!commonModel::hasPriv('instance', 'manage')) $this->loadModel('common')->deny('instance', 'manage', false);
/* This is essential when changing tab(menu) from gogs to repo. */
/* Optional: common::setMenuVars('devops', $this->session->repoID); */
if($this->app->rawMethod != 'binduser') $this->loadModel('ci')->setMenu();
+5
View File
@@ -21,6 +21,11 @@ class sonarqube extends control
parent::__construct($moduleName, $methodName);
if(!commonModel::hasPriv('space', 'browse')) $this->loadModel('common')->deny('space', 'browse', false);
if(!in_array($methodName, array('browseproject', 'reportview', 'browseissue')))
{
if(!commonModel::hasPriv('instance', 'manage')) $this->loadModel('common')->deny('instance', 'manage', false);
}
/* This is essential when changing tab(menu) from gitlab to repo. */
/* Optional: common::setMenuVars('devops', $this->session->repoID); */
$this->loadModel('ci')->setMenu();