(ctx context.Context, arg database.UpdateChatACLByIDParams)
| 6571 | } |
| 6572 | |
| 6573 | func (q *querier) UpdateChatACLByID(ctx context.Context, arg database.UpdateChatACLByIDParams) error { |
| 6574 | if rbac.ChatACLDisabled() { |
| 6575 | return NotAuthorizedError{Err: xerrors.New("chat sharing is disabled")} |
| 6576 | } |
| 6577 | fetch := func(ctx context.Context, arg database.UpdateChatACLByIDParams) (database.Chat, error) { |
| 6578 | chat, err := q.db.GetChatByID(ctx, arg.ID) |
| 6579 | if err != nil { |
| 6580 | return database.Chat{}, err |
| 6581 | } |
| 6582 | if chat.IsSubChat() { |
| 6583 | return database.Chat{}, NotAuthorizedError{Err: xerrors.New("chat ACLs can only be updated on root chats")} |
| 6584 | } |
| 6585 | return chat, nil |
| 6586 | } |
| 6587 | |
| 6588 | return fetchAndExec(q.log, q.auth, policy.ActionShare, fetch, q.db.UpdateChatACLByID)(ctx, arg) |
| 6589 | } |
| 6590 | |
| 6591 | func (q *querier) UpdateChatBuildAgentBinding(ctx context.Context, arg database.UpdateChatBuildAgentBindingParams) (database.Chat, error) { |
| 6592 | chat, err := q.db.GetChatByID(ctx, arg.ID) |
nothing calls this directly
no test coverage detected