mirror of
https://github.com/casdoor/casdoor.git
synced 2025-05-23 02:35:49 +08:00
feat: fix organizationChangeTrigger() and userChangeTrigger() bugs
This commit is contained in:
parent
69a8346d05
commit
03f005389f
@ -464,7 +464,9 @@ func organizationChangeTrigger(oldName string, newName string) error {
|
||||
record.Organization = newName
|
||||
_, err = session.Where("organization=?", oldName).Update(record)
|
||||
if err != nil {
|
||||
return err
|
||||
if err.Error() != "no columns found to be updated" {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
resource := new(Resource)
|
||||
|
@ -1021,6 +1021,10 @@ func userChangeTrigger(oldName string, newName string) error {
|
||||
}
|
||||
for _, permission := range permissions {
|
||||
for j, u := range permission.Users {
|
||||
if u == "*" {
|
||||
continue
|
||||
}
|
||||
|
||||
// u = organization/username
|
||||
owner, name := util.GetOwnerAndNameFromId(u)
|
||||
if name == oldName {
|
||||
|
Loading…
x
Reference in New Issue
Block a user