feat: fix update application failed for permissions with the same name (#2579)

* fixed: update application failed where have two same permission in different organization

* Update application.go

---------

Co-authored-by: hsluoyz <hsluoyz@qq.com>
This commit is contained in:
李洛克 2024-01-05 20:45:55 +08:00 committed by GitHub
parent 077a1cb8b7
commit 524cf4dda5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -664,7 +664,7 @@ func applicationChangeTrigger(oldName string, newName string) error {
}
}
permissions[i].Resources = permissionResoureces
_, err = session.Where("name=?", permissions[i].Name).Update(permissions[i])
_, err = session.Where("owner=?", permissions[i].Owner).Where("name=?", permissions[i].Name).Update(permissions[i])
if err != nil {
return err
}