mirror of
https://github.com/casdoor/casdoor.git
synced 2025-07-02 11:20:18 +08:00
feat: fix compatibility issue between Casbin request and model (#1478)
This commit is contained in:
@ -68,14 +68,14 @@ func getModel(owner string, name string) *Model {
|
||||
return nil
|
||||
}
|
||||
|
||||
model := Model{Owner: owner, Name: name}
|
||||
existed, err := adapter.Engine.Get(&model)
|
||||
m := Model{Owner: owner, Name: name}
|
||||
existed, err := adapter.Engine.Get(&m)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
if existed {
|
||||
return &model
|
||||
return &m
|
||||
} else {
|
||||
return nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user