mirror of
https://github.com/casdoor/casdoor.git
synced 2025-07-02 11:20:18 +08:00
feat: add organization context select box for admin (#2013)
* feat: organization as context * feat: organization as context with backend filtration * Update app.conf * update app.conf and hide organization select for mobile. --------- Co-authored-by: dplynsky <dplynsky@ptsecurity.com> Co-authored-by: hsluoyz <hsluoyz@qq.com>
This commit is contained in:
@ -104,10 +104,15 @@ func GetOrganizationsByFields(owner string, fields ...string) ([]*Organization,
|
||||
return organizations, nil
|
||||
}
|
||||
|
||||
func GetPaginationOrganizations(owner string, offset, limit int, field, value, sortField, sortOrder string) ([]*Organization, error) {
|
||||
func GetPaginationOrganizations(owner string, name string, offset, limit int, field, value, sortField, sortOrder string) ([]*Organization, error) {
|
||||
organizations := []*Organization{}
|
||||
session := GetSession(owner, offset, limit, field, value, sortField, sortOrder)
|
||||
err := session.Find(&organizations)
|
||||
var err error
|
||||
if name != "" {
|
||||
err = session.Find(&organizations, &Organization{Name: name})
|
||||
} else {
|
||||
err = session.Find(&organizations)
|
||||
}
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
Reference in New Issue
Block a user