mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
fix: scope combined chat source filters (#26137)
This commit is contained in:
@@ -750,9 +750,6 @@ type chatQuerier interface {
|
||||
}
|
||||
|
||||
func (q *sqlQuerier) GetAuthorizedChats(ctx context.Context, arg GetChatsParams, prepared rbac.PreparedAuthorized) ([]GetChatsRow, error) {
|
||||
if arg.OwnedOnly && arg.SharedOnly {
|
||||
return nil, xerrors.New("owned_only and shared_only cannot both be true")
|
||||
}
|
||||
if (arg.OwnedOnly || arg.SharedOnly) && arg.ViewerID == uuid.Nil {
|
||||
return nil, xerrors.New("viewer_id required when owned_only or shared_only is true")
|
||||
}
|
||||
@@ -774,8 +771,8 @@ func (q *sqlQuerier) GetAuthorizedChats(ctx context.Context, arg GetChatsParams,
|
||||
query := fmt.Sprintf("-- name: GetAuthorizedChats :many\n%s", filtered)
|
||||
rows, err := q.db.QueryContext(ctx, query,
|
||||
arg.OwnedOnly,
|
||||
arg.ViewerID,
|
||||
arg.SharedOnly,
|
||||
arg.ViewerID,
|
||||
arg.SharedWithUserID,
|
||||
pq.Array(arg.SharedWithGroupIds),
|
||||
arg.Archived,
|
||||
|
||||
Reference in New Issue
Block a user