Merge pull request #10979 from rainzm/cloudproxy/fix

fix for creating proxy endpoint
This commit is contained in:
yunion-ci-robot
2021-05-07 14:30:41 +08:00
committed by GitHub
3 changed files with 4 additions and 3 deletions
+2 -2
View File
@@ -110,8 +110,8 @@ func (man *SProxyEndpointManager) PerformCreateFromServer(ctx context.Context, u
IntranetIpAddr: nic.IpAddr,
}
proxyendpoint.Name = name
proxyendpoint.DomainId = userCred.GetProjectDomainId()
proxyendpoint.ProjectId = userCred.GetProjectId()
proxyendpoint.DomainId = serverInfo.Server.DomainId
proxyendpoint.ProjectId = serverInfo.Server.ProjectId
if err := man.TableSpec().Insert(ctx, proxyendpoint); err != nil {
return nil, httperrors.NewServerError("database insertion error: %v", err)
}
+1 -1
View File
@@ -41,7 +41,7 @@ func AddSshKeysHandler(prefix string, app *appsrv.Application) {
func adminSshKeysHandler(ctx context.Context, w http.ResponseWriter, r *http.Request) {
publicOnly := false
userCred := auth.FetchUserCredential(ctx, policy.FilterPolicyCredential)
if !userCred.IsAllow(rbacutils.ScopeSystem, consts.GetServiceType(), "sshkeypairs", policy.PolicyActionGet) {
if !userCred.IsAllow(rbacutils.ScopeDomain, consts.GetServiceType(), "sshkeypairs", policy.PolicyActionGet) {
publicOnly = true
}
params := appctx.AppContextParams(ctx)
+1
View File
@@ -77,6 +77,7 @@ type EnabledStatusStandaloneResource struct {
type VirtualResource struct {
StatusStandaloneResource
DomainId string
ProjectId string
IsSystem bool
PendingDeletedAt time.Time