mirror of
https://github.com/casdoor/casdoor.git
synced 2025-07-02 11:20:18 +08:00
Add GetOwnerAndNameFromIdNoCheck() to fix bug.
This commit is contained in:
@ -57,17 +57,17 @@ func getResource(owner string, name string) *Resource {
|
||||
if existed {
|
||||
return &resource
|
||||
}
|
||||
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func GetResource(id string) *Resource {
|
||||
owner, name := util.GetOwnerAndNameFromId(id)
|
||||
owner, name := util.GetOwnerAndNameFromIdNoCheck(id)
|
||||
return getResource(owner, name)
|
||||
}
|
||||
|
||||
func UpdateResource(id string, resource *Resource) bool {
|
||||
owner, name := util.GetOwnerAndNameFromId(id)
|
||||
owner, name := util.GetOwnerAndNameFromIdNoCheck(id)
|
||||
if getResource(owner, name) == nil {
|
||||
return false
|
||||
}
|
||||
|
Reference in New Issue
Block a user