mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-24 16:03:43 +08:00
Merge pull request #11199 from ioito/automated-cherry-pick-of-#11198-upstream-release-3.7
Automated cherry pick of #11198: fix(region): restrict account project mapping
This commit is contained in:
@@ -480,5 +480,6 @@ type CloudaccountEnableAutoSyncInput struct {
|
||||
|
||||
type CloudaccountProjectMappingInput struct {
|
||||
// 同步策略Id, 若不传此参数则解绑
|
||||
// 绑定同步策略要求当前云账号此刻未绑定其他同步策略
|
||||
ProjectMappingId string `json:"project_mapping_id"`
|
||||
}
|
||||
|
||||
@@ -2870,6 +2870,9 @@ func (self *SCloudaccount) PerformProjectMapping(ctx context.Context, userCred m
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if len(self.ProjectMappingId) > 0 && self.ProjectMappingId != input.ProjectMappingId {
|
||||
return nil, httperrors.NewInputParameterError("account %s has aleady bind project mapping %s", self.Name, self.ProjectMappingId)
|
||||
}
|
||||
}
|
||||
// no changes
|
||||
if self.ProjectMappingId == input.ProjectMappingId {
|
||||
|
||||
Reference in New Issue
Block a user