mirror of
https://github.com/casdoor/casdoor.git
synced 2025-07-02 11:20:18 +08:00
Show resource list page to users.
This commit is contained in:
@ -38,13 +38,14 @@ type Resource struct {
|
||||
Url string `xorm:"varchar(100)" json:"url"`
|
||||
}
|
||||
|
||||
func GetResources(owner string) []*Resource {
|
||||
if owner == "admin" {
|
||||
func GetResources(owner string, user string) []*Resource {
|
||||
if owner == "built-in" {
|
||||
owner = ""
|
||||
user = ""
|
||||
}
|
||||
|
||||
resources := []*Resource{}
|
||||
err := adapter.Engine.Desc("created_time").Find(&resources, &Resource{Owner: owner})
|
||||
err := adapter.Engine.Desc("created_time").Find(&resources, &Resource{Owner: owner, User: user})
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
Reference in New Issue
Block a user