mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-19 10:46:58 +08:00
fix: network is_public init value set to true for domain scope
This commit is contained in:
@@ -1324,8 +1324,10 @@ func isOverlapNetworks(nets []SNetwork, startIp netutils.IPV4Addr, endIp netutil
|
||||
func (self *SNetwork) CustomizeCreate(ctx context.Context, userCred mcclient.TokenCredential, ownerId mcclient.IIdentityProvider, query jsonutils.JSONObject, data jsonutils.JSONObject) error {
|
||||
if db.IsAdminAllowCreate(userCred, self.GetModelManager()) && ownerId.GetProjectId() == userCred.GetProjectId() && self.ServerType == api.NETWORK_TYPE_GUEST {
|
||||
self.IsPublic = true
|
||||
self.PublicScope = string(rbacutils.ScopeDomain)
|
||||
} else {
|
||||
self.IsPublic = false
|
||||
self.PublicScope = string(rbacutils.ScopeNone)
|
||||
}
|
||||
return self.SSharableVirtualResourceBase.CustomizeCreate(ctx, userCred, ownerId, query, data)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user