mirror of
https://github.com/zitadel/zitadel.git
synced 2024-12-13 03:24:26 +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 {
|
if withGranted {
|
||||||
db = db.Where("grant_owner = ? OR project_owner = ?", orgID, orgID)
|
db = db.Where("resource_owner = ? OR project_owner = ?", orgID, orgID)
|
||||||
} else {
|
} 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})
|
query := repository.PrepareSearchQuery(table, model.UserGrantSearchRequest{Limit: req.Limit, Offset: req.Offset, Queries: req.Queries})
|
||||||
count, err := query(db, &grants)
|
count, err := query(db, &grants)
|
||||||
|
Loading…
Reference in New Issue
Block a user