grants: List in alphabetical order
This commit is contained in:
parent
9db53d39c4
commit
8f362172db
1 changed files with 2 additions and 2 deletions
|
|
@ -76,7 +76,7 @@ func (policy *Policy) User(ctx context.Context, username string) (grants []model
|
|||
}
|
||||
|
||||
// find the grants
|
||||
err = table.Find(&grants, models.Grant{User: username}).Error
|
||||
err = table.Find(&grants, models.Grant{User: username}).Order("slug asc").Error
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
@ -96,7 +96,7 @@ func (policy *Policy) Instance(ctx context.Context, slug string) (grants []model
|
|||
}
|
||||
|
||||
// find the grants
|
||||
err = table.Find(&grants, models.Grant{Slug: slug}).Error
|
||||
err = table.Find(&grants, models.Grant{Slug: slug}).Order("user asc").Error
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue