yunionconfig build error fix

This commit is contained in:
TangBin
2018-12-01 14:52:01 +08:00
parent 36435eeb28
commit a543901e2f
6 changed files with 9 additions and 11 deletions
+1 -1
View File
@@ -153,4 +153,4 @@ func IsAdminAllowUpdate(userCred mcclient.TokenCredential, obj IModel) bool {
func IsAdminAllowDelete(userCred mcclient.TokenCredential, obj IModel) bool {
return userCred.IsAdminAllow(consts.GetServiceType(), obj.KeywordPlural(), policy.PolicyActionDelete)
}
}
-1
View File
@@ -235,7 +235,6 @@ func (p *SLoadbalancerAgentParams) IsZero() bool {
return false
}
func (self *SLoadbalancerAgentManager) AllowListItems(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject) bool {
return db.IsAdminAllowList(userCred, self)
}
-1
View File
@@ -198,7 +198,6 @@ func (self *SStorage) IsLocal() bool {
return self.StorageType == STORAGE_LOCAL || self.StorageType == STORAGE_BAREMETAL
}
func (self *SStorage) getMoreDetails(extra *jsonutils.JSONDict) *jsonutils.JSONDict {
used := self.GetUsedCapacity(tristate.True)
waste := self.GetUsedCapacity(tristate.False)
+1 -1
View File
@@ -9,6 +9,7 @@ import (
"yunion.io/x/jsonutils"
"yunion.io/x/onecloud/pkg/appsrv"
"yunion.io/x/onecloud/pkg/cloudcommon/policy"
"yunion.io/x/onecloud/pkg/httperrors"
"yunion.io/x/onecloud/pkg/mcclient"
"yunion.io/x/onecloud/pkg/mcclient/auth"
@@ -17,7 +18,6 @@ import (
"yunion.io/x/onecloud/pkg/webconsole/command"
o "yunion.io/x/onecloud/pkg/webconsole/options"
"yunion.io/x/onecloud/pkg/webconsole/session"
"yunion.io/x/onecloud/pkg/cloudcommon/policy"
)
const (
+1 -1
View File
@@ -12,10 +12,10 @@ import (
"net/http"
"yunion.io/x/onecloud/pkg/cloudcommon"
"yunion.io/x/onecloud/pkg/cloudcommon/consts"
"yunion.io/x/onecloud/pkg/webconsole"
o "yunion.io/x/onecloud/pkg/webconsole/options"
"yunion.io/x/onecloud/pkg/webconsole/server"
"yunion.io/x/onecloud/pkg/cloudcommon/consts"
)
func ensureBinExists(binPath string) {
+6 -6
View File
@@ -5,14 +5,14 @@ import (
"yunion.io/x/jsonutils"
"yunion.io/x/log"
"yunion.io/x/onecloud/pkg/cloudcommon/consts"
"yunion.io/x/onecloud/pkg/cloudcommon/db"
"yunion.io/x/onecloud/pkg/cloudcommon/policy"
"yunion.io/x/onecloud/pkg/httperrors"
"yunion.io/x/onecloud/pkg/mcclient"
"yunion.io/x/pkg/util/timeutils"
"yunion.io/x/pkg/utils"
"yunion.io/x/sqlchemy"
"yunion.io/x/onecloud/pkg/cloudcommon/consts"
"yunion.io/x/onecloud/pkg/cloudcommon/policy"
)
const (
@@ -72,9 +72,9 @@ func getNamespaceInContext(userCred mcclient.TokenCredential, query jsonutils.JS
}
}
func getNamespace(userCred mcclient.TokenCredential, query jsonutils.JSONObject, data *jsonutils.JSONDict) (string, string, error) {
func getNamespace(userCred mcclient.TokenCredential, resource string, query jsonutils.JSONObject, data *jsonutils.JSONDict) (string, string, error) {
var namespace, namespace_id string
if db.IsAdminAllowGet(userCred, ParameterManager) {
if userCred.IsAdminAllow(consts.GetServiceType(), resource, policy.PolicyActionList) {
if name, nameId, e := getNamespaceInContext(userCred, query, data); e != nil {
return "", "", e
} else {
@@ -113,7 +113,7 @@ func (manager *SParameterManager) ValidateCreateData(ctx context.Context, userCr
return nil, httperrors.NewUserNotFoundError("user not found")
}
namespace, namespace_id, e := getNamespace(userCred, query, data)
namespace, namespace_id, e := getNamespace(userCred, manager.KeywordPlural(), query, data)
if e != nil {
return nil, e
}
@@ -182,7 +182,7 @@ func (model *SParameter) ValidateUpdateData(ctx context.Context, userCred mcclie
return nil, httperrors.NewUserNotFoundError("user not found")
}
namespace, namespace_id, e := getNamespace(userCred, query, data)
namespace, namespace_id, e := getNamespace(userCred, model.KeywordPlural(), query, data)
if e != nil {
return nil, e
}