diff --git a/api/restHandler/DeploymentConfigurationRestHandler.go b/api/restHandler/DeploymentConfigurationRestHandler.go index a29776a6b6..144838da01 100644 --- a/api/restHandler/DeploymentConfigurationRestHandler.go +++ b/api/restHandler/DeploymentConfigurationRestHandler.go @@ -115,9 +115,11 @@ func (handler *DeploymentConfigurationRestHandlerImpl) enforceForAppAndEnv(appNa return false } - object = handler.enforcerUtil.GetEnvRBACNameByAppAndEnvName(appName, envName) - if ok := handler.enforcer.Enforce(token, casbin.ResourceEnvironment, action, object); !ok { - return false + if len(envName) > 0 { + object = handler.enforcerUtil.GetEnvRBACNameByAppAndEnvName(appName, envName) + if ok := handler.enforcer.Enforce(token, casbin.ResourceEnvironment, action, object); !ok { + return false + } } return true } diff --git a/pkg/configDiff/DeploymentConfigurationService.go b/pkg/configDiff/DeploymentConfigurationService.go index 360de7f8b3..f64de5cd2f 100644 --- a/pkg/configDiff/DeploymentConfigurationService.go +++ b/pkg/configDiff/DeploymentConfigurationService.go @@ -63,6 +63,7 @@ func (impl *DeploymentConfigurationServiceImpl) ConfigAutoComplete(appId int, en if _, ok := cmcsKeyPropertyEnvLevelMap[key]; !ok { if envId > 0 { configProperty.ConfigStage = bean2.Inheriting + configProperty.Id = 0 } }