mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-21 06:09:39 +08:00
fix(region): admin update without verification
This commit is contained in:
@@ -809,10 +809,6 @@ func (r *SReceiver) PreUpdate(ctx context.Context, userCred mcclient.TokenCreden
|
||||
if err != nil {
|
||||
log.Errorf("PushCache: %v", err)
|
||||
}
|
||||
err = ReceiverManager.TableSpec().InsertOrUpdate(ctx, r)
|
||||
if err != nil {
|
||||
log.Errorf("InsertOrUpdate: %v", err)
|
||||
}
|
||||
// 管理后台修改联系人,如果修改或者启用手机号和邮箱,无需进行校验
|
||||
allowScope := policy.PolicyManager.AllowScope(userCred, api.SERVICE_TYPE, ReceiverManager.KeywordPlural(), policy.PolicyActionCreate)
|
||||
if allowScope == rbacutils.ScopeSystem {
|
||||
@@ -831,6 +827,10 @@ func (r *SReceiver) PreUpdate(ctx context.Context, userCred mcclient.TokenCreden
|
||||
r.VerifiedMobile = tristate.True
|
||||
}
|
||||
}
|
||||
err = ReceiverManager.TableSpec().InsertOrUpdate(ctx, r)
|
||||
if err != nil {
|
||||
log.Errorf("InsertOrUpdate: %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
func (r *SReceiver) PostUpdate(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, data jsonutils.JSONObject) {
|
||||
|
||||
Reference in New Issue
Block a user