mirror of https://github.com/milvus-io/milvus.git
fix: grant v2 collection name and privilege error typo (#38195)
issue: https://github.com/milvus-io/milvus/issues/38042 Signed-off-by: shaoting-huang <shaoting.huang@zilliz.com>pull/38212/head
parent
262f6db3d8
commit
a65d395ecd
|
@ -5365,7 +5365,7 @@ func (node *Proxy) validateOperatePrivilegeV2Params(req *milvuspb.OperatePrivile
|
|||
return err
|
||||
}
|
||||
}
|
||||
if err := ValidateObjectName(req.CollectionName); err != nil {
|
||||
if err := ValidateCollectionName(req.CollectionName); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
|
|
|
@ -1102,6 +1102,13 @@ func ValidateObjectName(entity string) error {
|
|||
return validateName(entity, "object name")
|
||||
}
|
||||
|
||||
func ValidateCollectionName(entity string) error {
|
||||
if util.IsAnyWord(entity) {
|
||||
return nil
|
||||
}
|
||||
return validateName(entity, "collection name")
|
||||
}
|
||||
|
||||
func ValidateObjectType(entity string) error {
|
||||
return validateName(entity, "ObjectType")
|
||||
}
|
||||
|
|
|
@ -461,7 +461,7 @@ func WrapErrDatabaseNameInvalid(database any, msg ...string) error {
|
|||
}
|
||||
|
||||
func WrapErrPrivilegeGroupNameInvalid(privilegeGroup any, msg ...string) error {
|
||||
err := wrapFields(ErrPrivilegeGroupInvalidName, value("privielgeGroup", privilegeGroup))
|
||||
err := wrapFields(ErrPrivilegeGroupInvalidName, value("privilegeGroup", privilegeGroup))
|
||||
if len(msg) > 0 {
|
||||
err = errors.Wrap(err, strings.Join(msg, "->"))
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue