Fix delete-resource authz check.

This commit is contained in:
Gucheng Wang 2022-03-11 11:27:52 +08:00
parent e7018e3de4
commit 37a26e2a91

View File

@ -84,8 +84,8 @@ func getObject(ctx *context.Context) (string, string) {
if path == "/api/delete-resource" {
tokens := strings.Split(obj.Name, "/")
if len(tokens) >= 2 {
obj.Name = tokens[len(tokens)-2]
if len(tokens) >= 5 {
obj.Name = tokens[4]
}
}