mirror of
https://github.com/casdoor/casdoor.git
synced 2025-07-02 19:40:19 +08:00
Support LDAP search by user tag
This commit is contained in:
@ -250,6 +250,16 @@ func GetUsers(owner string) []*User {
|
||||
return users
|
||||
}
|
||||
|
||||
func GetUsersByTag(owner string, tag string) []*User {
|
||||
users := []*User{}
|
||||
err := adapter.Engine.Desc("created_time").Find(&users, &User{Owner: owner, Tag: tag})
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
return users
|
||||
}
|
||||
|
||||
func GetSortedUsers(owner string, sorter string, limit int) []*User {
|
||||
users := []*User{}
|
||||
err := adapter.Engine.Desc(sorter).Limit(limit, 0).Find(&users, &User{Owner: owner})
|
||||
|
Reference in New Issue
Block a user