File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
dbm-services/mysql/db-priv/service/v2/add_priv Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -36,6 +36,21 @@ func (c *PrivTaskPara) AddPriv(jsonPara, ticket string) (err error) {
3636 if c .ClusterType == "" {
3737 return errno .ClusterTypeIsEmpty
3838 }
39+ if c .SourceIPs == nil || len (c .SourceIPs ) == 0 {
40+ return errno .GrantPrivilegesParameterCheckFail
41+ }
42+ if c .TargetInstances == nil || len (c .TargetInstances ) == 0 {
43+ return errno .GrantPrivilegesParameterCheckFail
44+ }
45+ if c .AccoutRules == nil || len (c .AccoutRules ) == 0 {
46+ return errno .GrantPrivilegesParameterCheckFail
47+ }
48+ if c .User == "" {
49+ return errno .GrantPrivilegesParameterCheckFail
50+ }
51+ if c .ClusterType == "" {
52+ return errno .GrantPrivilegesParameterCheckFail
53+ }
3954
4055 c .SourceIPs = internal .UniqueStringSlice (c .SourceIPs )
4156 // targetInstance 传入的其实全是域名
You can’t perform that action at this time.
0 commit comments