* Fix bug #38290.
This commit is contained in:
+13
-1
@@ -291,10 +291,22 @@ $config->openMethods[] = 'instance.createexternalapp';
|
||||
$config->openMethods[] = 'instance.editexternalapp';
|
||||
$config->openMethods[] = 'instance.deleteexternalapp';
|
||||
$config->openMethods[] = 'instance.setting';
|
||||
$config->openMethods[] = 'instance.ajaxDBAuthUrl';
|
||||
$config->openMethods[] = 'instance.ajaxdbauthurl';
|
||||
$config->openMethods[] = 'instance.view';
|
||||
$config->openMethods[] = 'instance.install';
|
||||
$config->openMethods[] = 'instance.visit';
|
||||
$config->openMethods[] = 'instance.ajaxstatus';
|
||||
$config->openMethods[] = 'instance.ajaxstart';
|
||||
$config->openMethods[] = 'instance.ajaxstop';
|
||||
$config->openMethods[] = 'instance.upgrade';
|
||||
$config->openMethods[] = 'instance.ajaxuninstall';
|
||||
$config->openMethods[] = 'search.deletezinquery';
|
||||
$config->openMethods[] = 'space.edit';
|
||||
$config->openMethods[] = 'space.binduser';
|
||||
$config->openMethods[] = 'space.getstoreappinfo';
|
||||
$config->openMethods[] = 'store.browse';
|
||||
$config->openMethods[] = 'store.appview';
|
||||
$config->openMethods[] = 'system.editdomain';
|
||||
|
||||
$config->openModules = array();
|
||||
$config->openModules[] = 'install';
|
||||
|
||||
+16
-82
@@ -130,7 +130,6 @@ VALUES
|
||||
(677, 674, '', 'package', ',open,biz,max,ipd,', ',rnd,', 2820),
|
||||
(678, 515, 'application', 'package', ',open,biz,max,ipd,', ',rnd,', 2840),
|
||||
(679, 515, 'application', 'package', ',open,biz,max,ipd,', ',rnd,', 2860),
|
||||
(680, 515, 'application', 'package', ',open,biz,max,ipd,', ',rnd,', 2880),
|
||||
(515, 502, 'app', 'module', ',open,biz,max,ipd,', ',rnd,', 3000),
|
||||
(563, 502, 'deploy', 'module', ',biz,max,ipd,', ',rnd,', 3020),
|
||||
(130, 557, '', 'package', ',biz,max,ipd,', ',rnd,lite,or,', 2270);
|
||||
@@ -144,9 +143,9 @@ REPLACE INTO
|
||||
`zt_priv` (`id`, `module`, `method`, `parent`, `edition`, `vision`, `system`, `order`)
|
||||
VALUES
|
||||
(2136, 'system', 'dashboard', 658, ',open,biz,max,ipd,', ',rnd,', '1', 5),
|
||||
(1285, 'system', 'dblist', 126, ',biz,max,ipd,', ',rnd,', '1', 5),
|
||||
(1286, 'system', 'configdomain', 126, ',biz,max,ipd,', ',rnd,', '1', 10),
|
||||
(2137, 'system', 'ossview', 126, ',biz,max,ipd,', ',rnd,', '1', 15),
|
||||
(1285, 'system', 'dblist', 126, ',open,biz,max,ipd,', ',rnd,', '1', 5),
|
||||
(1286, 'system', 'configdomain', 126, ',open,biz,max,ipd,', ',rnd,', '1', 10),
|
||||
(2137, 'system', 'ossview', 126, ',open,biz,max,ipd,', ',rnd,', '1', 15),
|
||||
(2138, 'ops', 'provide', 660, ',open,biz,max,ipd,', ',rnd,', '1', 20),
|
||||
(2139, 'ops', 'city', 661, ',open,biz,max,ipd,', ',rnd,', '1', 25),
|
||||
(2140, 'ops', 'cpubrand', 662, ',open,biz,max,ipd,', ',rnd,', '1', 30),
|
||||
@@ -207,17 +206,7 @@ VALUES
|
||||
(2146, 'artifactrepo', 'ajaxUpdateArtifactRepos', 676, ',open,biz,max,ipd,', ',rnd,', '1', 15),
|
||||
(2147, 'artifactrepo', 'delete', 677, ',open,biz,max,ipd,', ',rnd,', '1', 5),
|
||||
(2148, 'space', 'browse', 678, ',open,biz,max,ipd,', ',rnd,', '1', 5),
|
||||
(2149, 'instance', 'view', 678, ',open,biz,max,ipd,', ',rnd,', '1', 10),
|
||||
(2158, 'store', 'browse', 678, ',open,biz,max,ipd,', ',rnd,', '1', 15),
|
||||
(2159, 'store', 'appView', 678, ',open,biz,max,ipd,', ',rnd,', '1', 20),
|
||||
(2150, 'space', 'getStoreAppInfo', 678, ',open,biz,max,ipd,', ',rnd,', '1', 25),
|
||||
(2151, 'instance', 'install', 679, ',open,biz,max,ipd,', ',rnd,', '1', 10),
|
||||
(2152, 'instance', 'visit', 679, ',open,biz,max,ipd,', ',rnd,', '1', 5),
|
||||
(2153, 'instance', 'ajaxStatus', 679, ',open,biz,max,ipd,', ',rnd,', '1', 15),
|
||||
(2154, 'instance', 'ajaxStart', 679, ',open,biz,max,ipd,', ',rnd,', '1', 20),
|
||||
(2155, 'instance', 'ajaxStop', 679, ',open,biz,max,ipd,', ',rnd,', '1', 25),
|
||||
(2157, 'instance', 'upgrade', 679, ',open,biz,max,ipd,', ',rnd,', '1', 30),
|
||||
(2156, 'instance', 'ajaxUninstall', 680, ',open,biz,max,ipd,', ',rnd,', '1', 5),
|
||||
(2149, 'instance', 'manage', 679, ',open,biz,max,ipd,', ',rnd,', '1', 10),
|
||||
(2160, 'ops', 'stage', 132, ',biz,max,ipd,', ',rnd,', '1', 10);
|
||||
|
||||
REPLACE INTO
|
||||
@@ -370,16 +359,11 @@ VALUES
|
||||
(678, 'manager', 'de', '', 'Application List', ''),
|
||||
(678, 'manager', 'en', '', 'Application List', ''),
|
||||
(678, 'manager', 'fr', '', 'Application List', ''),
|
||||
(679, 'manager', 'zh-cn', '', '创建维护应用', ''),
|
||||
(679, 'manager', 'zh-tw', '', '创建维护應用', ''),
|
||||
(679, 'manager', 'zh-cn', '', '管理应用', ''),
|
||||
(679, 'manager', 'zh-tw', '', '管理應用', ''),
|
||||
(679, 'manager', 'de', '', 'Manage Application', ''),
|
||||
(679, 'manager', 'en', '', 'Manage Application', ''),
|
||||
(679, 'manager', 'fr', '', 'Manage Application', ''),
|
||||
(680, 'manager', 'zh-cn', '', '删除应用', ''),
|
||||
(680, 'manager', 'zh-tw', '', '刪除應用', ''),
|
||||
(680, 'manager', 'de', '', 'Delete Application', ''),
|
||||
(680, 'manager', 'en', '', 'Delete Application', ''),
|
||||
(680, 'manager', 'fr', '', 'Delete Application', ''),
|
||||
(2136, 'priv', 'zh-cn', 'system-dashboard', 'DevOps平台仪表盘', ''),
|
||||
(2136, 'priv', 'zh-tw', 'system-dashboard', 'DevOps平臺儀表盤', ''),
|
||||
(2136, 'priv', 'de', 'system-dashboard', 'DevOps Dashboard', ''),
|
||||
@@ -490,66 +474,16 @@ VALUES
|
||||
(2147, 'priv', 'de', 'artifactrepo-delete', 'Delete Artifact Repo', ''),
|
||||
(2147, 'priv', 'en', 'artifactrepo-delete', 'Delete Artifact Repo', ''),
|
||||
(2147, 'priv', 'fr', 'artifactrepo-delete', 'Delete Artifact Repo', ''),
|
||||
(2148, 'priv', 'zh-cn', 'space-browse', '', ''),
|
||||
(2148, 'priv', 'zh-tw', 'space-browse', '', ''),
|
||||
(2148, 'priv', 'de', 'space-browse', '', ''),
|
||||
(2148, 'priv', 'en', 'space-browse', '', ''),
|
||||
(2148, 'priv', 'fr', 'space-browse', '', ''),
|
||||
(2149, 'priv', 'zh-cn', 'instance-view', '', ''),
|
||||
(2149, 'priv', 'zh-tw', 'instance-view', '', ''),
|
||||
(2149, 'priv', 'de', 'instance-view', '', ''),
|
||||
(2149, 'priv', 'en', 'instance-view', '', ''),
|
||||
(2149, 'priv', 'fr', 'instance-view', '', ''),
|
||||
(2158, 'priv', 'zh-cn', 'store-browse', '', ''),
|
||||
(2158, 'priv', 'zh-tw', 'store-browse', '', ''),
|
||||
(2158, 'priv', 'de', 'store-browse', '', ''),
|
||||
(2158, 'priv', 'en', 'store-browse', '', ''),
|
||||
(2158, 'priv', 'fr', 'store-browse', '', ''),
|
||||
(2159, 'priv', 'zh-cn', 'store-appView', '上架应用详情', ''),
|
||||
(2159, 'priv', 'zh-tw', 'store-appView', '上架應用詳情', ''),
|
||||
(2159, 'priv', 'de', 'store-appView', 'APP Store Detail', ''),
|
||||
(2159, 'priv', 'en', 'store-appView', 'APP Store Detail', ''),
|
||||
(2159, 'priv', 'fr', 'store-appView', 'APP Store Detail', ''),
|
||||
(2150, 'priv', 'zh-cn', 'space-getStoreAppInfo', '接口:获取商店应用信息', ''),
|
||||
(2150, 'priv', 'zh-tw', 'space-getStoreAppInfo', '接口:獲取商店應用信息', ''),
|
||||
(2150, 'priv', 'de', 'space-getStoreAppInfo', 'Api: Get Store APP Info', ''),
|
||||
(2150, 'priv', 'en', 'space-getStoreAppInfo', 'Api: Get Store APP Info', ''),
|
||||
(2150, 'priv', 'fr', 'space-getStoreAppInfo', 'Api: Get Store APP Info', ''),
|
||||
(2151, 'priv', 'zh-cn', 'instance-install', '安装应用', ''),
|
||||
(2151, 'priv', 'zh-tw', 'instance-install', '安裝應用', ''),
|
||||
(2151, 'priv', 'de', 'instance-install', 'Install', ''),
|
||||
(2151, 'priv', 'en', 'instance-install', 'Install', ''),
|
||||
(2151, 'priv', 'fr', 'instance-install', 'Install', ''),
|
||||
(2152, 'priv', 'zh-cn', 'instance-visit', '访问应用', ''),
|
||||
(2152, 'priv', 'zh-tw', 'instance-visit', '訪問應用', ''),
|
||||
(2152, 'priv', 'de', 'instance-visit', 'Visit', ''),
|
||||
(2152, 'priv', 'en', 'instance-visit', 'Visit', ''),
|
||||
(2152, 'priv', 'fr', 'instance-visit', 'Visit', ''),
|
||||
(2153, 'priv', 'zh-cn', 'instance-ajaxStatus', '接口:应用状态', ''),
|
||||
(2153, 'priv', 'zh-tw', 'instance-ajaxStatus', '接口:應用狀態', ''),
|
||||
(2153, 'priv', 'de', 'instance-ajaxStatus', 'Api: App status', ''),
|
||||
(2153, 'priv', 'en', 'instance-ajaxStatus', 'Api: App status', ''),
|
||||
(2153, 'priv', 'fr', 'instance-ajaxStatus', 'Api: App status', ''),
|
||||
(2154, 'priv', 'zh-cn', 'instance-ajaxStart', '开启应用', ''),
|
||||
(2154, 'priv', 'zh-tw', 'instance-ajaxStart', '開啓應用', ''),
|
||||
(2154, 'priv', 'de', 'instance-ajaxStart', 'Start', ''),
|
||||
(2154, 'priv', 'en', 'instance-ajaxStart', 'Start', ''),
|
||||
(2154, 'priv', 'fr', 'instance-ajaxStart', 'Start', ''),
|
||||
(2155, 'priv', 'zh-cn', 'instance-ajaxStop', '关闭应用', ''),
|
||||
(2155, 'priv', 'zh-tw', 'instance-ajaxStop', '關閉應用', ''),
|
||||
(2155, 'priv', 'de', 'instance-ajaxStop', 'Stop', ''),
|
||||
(2155, 'priv', 'en', 'instance-ajaxStop', 'Stop', ''),
|
||||
(2155, 'priv', 'fr', 'instance-ajaxStop', 'Stop', ''),
|
||||
(2157, 'priv', 'zh-cn', 'instance-upgrade', '升级应用', ''),
|
||||
(2157, 'priv', 'zh-tw', 'instance-upgrade', '升級應用', ''),
|
||||
(2157, 'priv', 'de', 'instance-upgrade', 'Upgrade', ''),
|
||||
(2157, 'priv', 'en', 'instance-upgrade', 'Upgrade', ''),
|
||||
(2157, 'priv', 'fr', 'instance-upgrade', 'Upgrade', ''),
|
||||
(2156, 'priv', 'zh-cn', 'instance-ajaxUninstall', '删除应用', ''),
|
||||
(2156, 'priv', 'zh-tw', 'instance-ajaxUninstall', '刪除應用', ''),
|
||||
(2156, 'priv', 'de', 'instance-ajaxUninstall', 'Delete', ''),
|
||||
(2156, 'priv', 'en', 'instance-ajaxUninstall', 'Delete', ''),
|
||||
(2156, 'priv', 'fr', 'instance-ajaxUninstall', 'Delete', ''),
|
||||
(2148, 'priv', 'zh-cn', 'space-browse', '查看应用', ''),
|
||||
(2148, 'priv', 'zh-tw', 'space-browse', '查看應用', ''),
|
||||
(2148, 'priv', 'de', 'space-browse', 'Application List', ''),
|
||||
(2148, 'priv', 'en', 'space-browse', 'Application List', ''),
|
||||
(2148, 'priv', 'fr', 'space-browse', 'Application List', ''),
|
||||
(2149, 'priv', 'zh-cn', 'instance-manage', '管理应用', ''),
|
||||
(2149, 'priv', 'zh-tw', 'instance-manage', '管理應用', ''),
|
||||
(2149, 'priv', 'de', 'instance-manage', 'Manage Application', ''),
|
||||
(2149, 'priv', 'en', 'instance-manage', 'Manage Application', ''),
|
||||
(2149, 'priv', 'fr', 'instance-manage', 'Manage Application', ''),
|
||||
(2160, 'priv', 'zh-cn', 'ops-stage', '设置阶段', ''),
|
||||
(2160, 'priv', 'zh-tw', 'ops-stage', '設置階段', ''),
|
||||
(2160, 'priv', 'de', 'ops-stage', 'Stage Setting', ''),
|
||||
|
||||
+3
-3
File diff suppressed because one or more lines are too long
@@ -712,6 +712,8 @@ function initItemActions(object &$item, string $actionMenu, array $actionList, o
|
||||
}
|
||||
}
|
||||
|
||||
if(method_exists($model, 'isDisplay') && !$model->isDisplay($item, $method)) return $isClickable;
|
||||
|
||||
if(!$method || !common::hasPriv($module, $method)) return $isClickable;
|
||||
|
||||
$item->actions[] = array('name' => $action, 'disabled' => !$isClickable);
|
||||
|
||||
@@ -1381,24 +1381,6 @@ $lang->serverroom->methodOrder[10] = 'edit';
|
||||
$lang->serverroom->methodOrder[15] = 'delete';
|
||||
$lang->serverroom->methodOrder[20] = 'view';
|
||||
|
||||
$lang->resource->instance = new stdclass();
|
||||
$lang->resource->instance->install = 'install';
|
||||
$lang->resource->instance->view = 'view';
|
||||
$lang->resource->instance->visit = 'visit';
|
||||
$lang->resource->instance->ajaxStatus = 'ajaxStatus';
|
||||
$lang->resource->instance->ajaxStart = 'ajaxStart';
|
||||
$lang->resource->instance->ajaxStop = 'ajaxStop';
|
||||
$lang->resource->instance->ajaxUninstall = 'ajaxUninstall';
|
||||
$lang->resource->instance->upgrade = 'upgrade';
|
||||
|
||||
$lang->resource->space = new stdclass();
|
||||
$lang->resource->space->browse = 'browse';
|
||||
$lang->resource->space->getStoreAppInfo = 'getStoreAppInfo';
|
||||
|
||||
$lang->resource->store = new stdclass();
|
||||
$lang->resource->store->browse = 'browse';
|
||||
$lang->resource->store->appView = 'appView';
|
||||
|
||||
/* Doc. */
|
||||
$lang->resource->doc = new stdclass();
|
||||
$lang->resource->doc->index = 'index';
|
||||
@@ -2039,6 +2021,8 @@ $lang->resource->repocode = new stdclass();
|
||||
$lang->resource->artifactrepo = new stdclass();
|
||||
$lang->resource->deploy = new stdclass();
|
||||
$lang->resource->ops = new stdclass();
|
||||
$lang->resource->instance = new stdclass();
|
||||
$lang->resource->space = new stdclass();
|
||||
|
||||
global $config;
|
||||
$inUpgrade = (defined('IN_UPGRADE') and IN_UPGRADE);
|
||||
|
||||
@@ -39,6 +39,7 @@ class instance extends control
|
||||
*/
|
||||
public function view($id, $type = 'store', $tab ='baseinfo' )
|
||||
{
|
||||
if(!commonModel::hasPriv('space', 'browse')) $this->loadModel('common')->deny('space', 'browse', false);
|
||||
if($type === 'store')
|
||||
{
|
||||
$this->storeView($id, $tab);
|
||||
@@ -90,6 +91,7 @@ class instance extends control
|
||||
*/
|
||||
protected function storeView($id, $tab ='baseinfo' )
|
||||
{
|
||||
if(!commonModel::hasPriv('space', 'browse')) $this->loadModel('common')->deny('space', 'browse', false);
|
||||
$this->loadModel('system');
|
||||
$this->app->loadLang('system');
|
||||
|
||||
@@ -269,7 +271,7 @@ class instance extends control
|
||||
*/
|
||||
public function setting($id)
|
||||
{
|
||||
if(!commonModel::hasPriv('instance', 'view')) $this->loadModel('common')->deny('instance', 'view', false);
|
||||
if(!commonModel::hasPriv('instance', 'manage')) $this->loadModel('common')->deny('instance', 'manage', false);
|
||||
$currentResource = new stdclass;
|
||||
$instance = $this->instance->getByID($id);
|
||||
$currentResource = $this->cne->getAppConfig($instance);
|
||||
@@ -347,6 +349,7 @@ class instance extends control
|
||||
*/
|
||||
public function upgrade($id)
|
||||
{
|
||||
if(!commonModel::hasPriv('instance', 'manage')) $this->loadModel('common')->deny('instance', 'manage', false);
|
||||
$instance = $this->instance->getByID($id);
|
||||
$instance->latestVersion = $this->store->appLatestVersion($instance->appID, $instance->version);
|
||||
|
||||
@@ -387,6 +390,7 @@ class instance extends control
|
||||
*/
|
||||
public function visit(int $id, int $externalID = 0): void
|
||||
{
|
||||
if(!commonModel::hasPriv('space', 'browse')) $this->loadModel('common')->deny('space', 'browse', false);
|
||||
if(!$externalID)
|
||||
{
|
||||
$instance = $this->instance->getByID($id);
|
||||
@@ -411,7 +415,7 @@ class instance extends control
|
||||
*/
|
||||
public function createExternalApp(string $type)
|
||||
{
|
||||
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->app->loadModuleConfig('sonarqube');
|
||||
$this->app->loadLang('pipeline');
|
||||
@@ -445,7 +449,7 @@ class instance extends control
|
||||
*/
|
||||
public function editExternalApp(int $externalID)
|
||||
{
|
||||
if(!commonModel::hasPriv('space', 'browse')) $this->loadModel('common')->deny('space', 'browse', false);
|
||||
if(!commonModel::hasPriv('instance', 'manage')) $this->loadModel('common')->deny('instance', 'manage', false);
|
||||
|
||||
$oldApp = $this->loadModel('pipeline')->getByID($externalID);
|
||||
|
||||
@@ -479,7 +483,7 @@ class instance extends control
|
||||
*/
|
||||
public function deleteExternalApp(int $externalID)
|
||||
{
|
||||
if(!commonModel::hasPriv('space', 'browse')) $this->loadModel('common')->deny('space', 'browse', false);
|
||||
if(!commonModel::hasPriv('instance', 'manage')) $this->loadModel('common')->deny('instance', 'manage', false);
|
||||
|
||||
$oldApp = $this->loadModel('pipeline')->getByID($externalID);
|
||||
$actionID = $this->pipeline->delete($externalID, $oldApp->type);
|
||||
@@ -524,6 +528,7 @@ class instance extends control
|
||||
*/
|
||||
public function install($appID)
|
||||
{
|
||||
if(!commonModel::hasPriv('instance', 'manage')) $this->loadModel('common')->deny('instance', 'manage', false);
|
||||
$cloudApp = $this->store->getAppInfo($appID);
|
||||
if(empty($cloudApp)) return $this->send(array('result' => 'fail', 'message' => $this->lang->instance->errors->noAppInfo));
|
||||
|
||||
@@ -618,6 +623,7 @@ class instance extends control
|
||||
*/
|
||||
public function ajaxUninstall($instanceID, $type = '')
|
||||
{
|
||||
if(!commonModel::hasPriv('instance', 'manage')) $this->loadModel('common')->deny('instance', 'manage', false);
|
||||
if($type !== 'store')
|
||||
{
|
||||
$instance = $this->loadModel('pipeline')->getByID($instanceID);
|
||||
@@ -652,6 +658,7 @@ class instance extends control
|
||||
*/
|
||||
public function ajaxStart($instanceID)
|
||||
{
|
||||
if(!commonModel::hasPriv('instance', 'manage')) $this->loadModel('common')->deny('instance', 'manage', false);
|
||||
$instance = $this->instance->getByID($instanceID);
|
||||
if(!$instance) return $this->send(array('result' => 'fail', 'message' => $this->lang->instance->instanceNotExists));
|
||||
|
||||
@@ -672,6 +679,7 @@ class instance extends control
|
||||
*/
|
||||
public function ajaxStop($instanceID)
|
||||
{
|
||||
if(!commonModel::hasPriv('instance', 'manage')) $this->loadModel('common')->deny('instance', 'manage', false);
|
||||
$instance = $this->instance->getByID($instanceID);
|
||||
if(!$instance) return $this->send(array('result' => 'fail', 'message' => $this->lang->instance->instanceNotExists));
|
||||
|
||||
@@ -690,6 +698,7 @@ class instance extends control
|
||||
*/
|
||||
public function ajaxStatus()
|
||||
{
|
||||
if(!commonModel::hasPriv('space', 'browse')) $this->loadModel('common')->deny('space', 'browse', false);
|
||||
$postData = fixer::input('post')->setDefault('idList', array())->get();
|
||||
|
||||
$instances = $this->instance->getByIdList($postData->idList);
|
||||
@@ -770,7 +779,7 @@ class instance extends control
|
||||
*/
|
||||
public function ajaxDBAuthUrl()
|
||||
{
|
||||
if(!commonModel::hasPriv('instance', 'view')) $this->loadModel('common')->deny('instance', 'view', false);
|
||||
if(!commonModel::hasPriv('space', 'browse')) $this->loadModel('common')->deny('space', 'browse', false);
|
||||
$post = fixer::input('post')
|
||||
->setDefault('namespace', 'default')
|
||||
->setDefault('instanceID', 0)
|
||||
@@ -804,6 +813,7 @@ class instance extends control
|
||||
*/
|
||||
public function ajaxAdjustMemory($instanceID)
|
||||
{
|
||||
if(!commonModel::hasPriv('instance', 'manage')) $this->loadModel('common')->deny('instance', 'manage', false);
|
||||
$postData = fixer::input('post')->get();
|
||||
|
||||
/* Check free memory size is enough or not. */
|
||||
|
||||
@@ -2060,6 +2060,21 @@ class InstanceModel extends model
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断按钮是否显示。
|
||||
* Adjust the action display.
|
||||
*
|
||||
* @param object $instance
|
||||
* @param string $action
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
public function isDisplay(object $instance, string $action): bool
|
||||
{
|
||||
if($action !== 'visit' && !commonModel::hasPriv('instance', 'manage')) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check app name unique.
|
||||
*
|
||||
|
||||
@@ -25,6 +25,7 @@ class space extends control
|
||||
*/
|
||||
public function browse($spaceID = null, $browseType = 'all', $orderBy = 'id_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1)
|
||||
{
|
||||
if(!commonModel::hasPriv('space', 'browse')) $this->loadModel('common')->deny('space', 'browse', false);
|
||||
$this->app->loadLang('instance');
|
||||
$this->loadModel('instance');
|
||||
$this->loadModel('store');
|
||||
@@ -112,7 +113,7 @@ class space extends control
|
||||
*/
|
||||
public function createApplication($appID = 0)
|
||||
{
|
||||
if(!commonModel::hasPriv('instance', 'install')) $this->loadModel('common')->deny('instance', 'install', false);
|
||||
if(!commonModel::hasPriv('instance', 'manage')) $this->loadModel('common')->deny('instance', 'manage', false);
|
||||
|
||||
$this->app->loadLang('sonarqube');
|
||||
$this->app->loadLang('jenkins');
|
||||
@@ -155,6 +156,7 @@ class space extends control
|
||||
*/
|
||||
public function getStoreAppInfo(int $appID)
|
||||
{
|
||||
if(!commonModel::hasPriv('space', 'browse')) $this->loadModel('common')->deny('space', 'browse', false);
|
||||
$cloudApp = $this->loadModel('store')->getAppInfo($appID);
|
||||
$versionPairs = $this->store->getVersionPairs($appID);
|
||||
$versionItems = array();
|
||||
|
||||
@@ -60,7 +60,7 @@ window.afterPageUpdate = function()
|
||||
{
|
||||
clearInterval(timer);
|
||||
statusMap[instance.id] = instance.status;
|
||||
loadPage();
|
||||
loadCurrentPage();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -47,6 +47,7 @@ class store extends control
|
||||
*/
|
||||
public function browse($sortType = 'create_time', $recPerPage = 0, $pageID = 1, $channel = '')
|
||||
{
|
||||
if(!commonModel::hasPriv('space', 'browse')) $this->loadModel('common')->deny('space', 'browse', false);
|
||||
global $config;
|
||||
if(empty($recPerPage)) $recPerPage = $this->cookie->pagerStoreBrowse ? $this->cookie->pagerStoreBrowse : 24;
|
||||
if(in_array( $channel, array('stable', 'test')))
|
||||
@@ -101,6 +102,7 @@ class store extends control
|
||||
*/
|
||||
public function appView($id, $pageID = 1, $recPerPage = 20)
|
||||
{
|
||||
if(!commonModel::hasPriv('space', 'browse')) $this->loadModel('common')->deny('space', 'browse', false);
|
||||
$appInfo = $this->store->getAppInfo($id, true);
|
||||
if(empty($appInfo)) return print(js::locate('back', 'parent'));
|
||||
|
||||
|
||||
@@ -447,6 +447,7 @@ class system extends control
|
||||
*/
|
||||
public function editDomain()
|
||||
{
|
||||
if(!commonModel::hasPriv('system', 'configDomain')) $this->loadModel('common')->deny('system', 'configDomain', false);
|
||||
$this->loadModel('instance');
|
||||
|
||||
if($_POST)
|
||||
|
||||
Reference in New Issue
Block a user