mirror of
https://github.com/zitadel/zitadel.git
synced 2024-12-12 02:54:20 +00:00
fix: query correct column (#991)
* fix(management): search user grants with granted * fix(auth): handle user grant project owner * fix: grantowner to resourceowner * fix: generate mock * fix: mig * fix: query correct columns * fix: remove new line
This commit is contained in:
parent
93e941a475
commit
9c603d9b38
@ -57,9 +57,9 @@ func SearchUserGrants(db *gorm.DB, table string, req *grant_model.UserGrantSearc
|
||||
}
|
||||
|
||||
if withGranted {
|
||||
db = db.Where("grant_owner = ? OR project_owner = ?", orgID, orgID)
|
||||
db = db.Where("resource_owner = ? OR project_owner = ?", orgID, orgID)
|
||||
} else {
|
||||
db = db.Where("grant_owner = ?", orgID)
|
||||
db = db.Where("resource_owner = ?", orgID)
|
||||
}
|
||||
query := repository.PrepareSearchQuery(table, model.UserGrantSearchRequest{Limit: req.Limit, Offset: req.Offset, Queries: req.Queries})
|
||||
count, err := query(db, &grants)
|
||||
|
Loading…
Reference in New Issue
Block a user