mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-11 21:37:32 +00:00
feat: delete (#243)
* feat: project role remove * feat: search queries * feat: search queries * feat: cascade remove/change project role * fix: comment in project grant * fix: remove projecr grant * fix: only search usergrants of my org * fix: delete usergrants * fix: delete usergrants * fix: check if role exists on project grant * feat: bulk add project role * fix: tests * fix: update user grants on project update * fix: return roles * feat: add resourceowner name on project grants * fix: migration number * fix: tests * fix: generate protos * fix: some unnecessary code
This commit is contained in:
@@ -5,6 +5,7 @@ import (
|
||||
caos_errs "github.com/caos/zitadel/internal/errors"
|
||||
"github.com/caos/zitadel/internal/model"
|
||||
"github.com/jinzhu/gorm"
|
||||
"github.com/lib/pq"
|
||||
)
|
||||
|
||||
type SearchRequest interface {
|
||||
@@ -102,10 +103,14 @@ func SetQuery(query *gorm.DB, key ColumnKey, value interface{}, method model.Sea
|
||||
query = query.Where(column+" > ?", value)
|
||||
case model.SEARCHMETHOD_LESS_THAN:
|
||||
query = query.Where(column+" < ?", value)
|
||||
case model.SEARCHMETHOD_IN:
|
||||
case model.SEARCHMETHOD_IS_ONE_OF:
|
||||
query = query.Where(column+" IN (?)", value)
|
||||
case model.SEARCHMETHOD_EQUALS_IN_ARRAY:
|
||||
query = query.Where("? <@ "+column, value)
|
||||
case model.SEARCHMETHOD_LIST_CONTAINS:
|
||||
valueText, ok := value.(string)
|
||||
if !ok {
|
||||
return nil, caos_errs.ThrowInvalidArgument(nil, "VIEW-Psois", "list contains only possible for strings")
|
||||
}
|
||||
query = query.Where("? <@ "+column, pq.Array([]string{valueText}))
|
||||
default:
|
||||
return nil, nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user