feat: APIs to assign agents_bots as assignee in conversations (#12836)
## Summary - add an assignee_agent_bot_id column as an initital step to prototype this before fully switching to polymorphic assignee - update assignment APIs and conversation list / show endpoints to reflect assignee as agent bot - ensure webhook payloads contains agent bot assignee [Codex Task](https://chatgpt.com/codex/tasks/task_e_6912833377e48326b6641b9eee32d50f) --------- Co-authored-by: Pranav <pranav@chatwoot.com>
This commit is contained in:
@@ -25,6 +25,9 @@ module EnsureCurrentAccountHelper
|
||||
end
|
||||
|
||||
def account_accessible_for_bot?(account)
|
||||
render_unauthorized('Bot is not authorized to access this account') unless @resource.agent_bot_inboxes.find_by(account_id: account.id)
|
||||
return if @resource.account_id == account.id
|
||||
return if @resource.agent_bot_inboxes.find_by(account_id: account.id)
|
||||
|
||||
render_unauthorized('Bot is not authorized to access this account')
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user