feat: trigger handoff when agent bot is the actor (#8639)

- This PR adds a feature to auto-trigger handoff events when an Agent bot toggles a conversation status from Pending to Open

Co-authored-by: Sojan <sojan@pepalo.com>
This commit is contained in:
Shivam Mishra
2024-01-06 04:56:52 +05:30
committed by GitHub
parent dc4e13b300
commit 56fbbe92b4
4 changed files with 56 additions and 4 deletions

View File

@@ -21,7 +21,7 @@ class InboxPolicy < ApplicationPolicy
def show?
# FIXME: for agent bots, lets bring this validation to policies as well in future
return true if @user.blank?
return true if @user.is_a?(AgentBot)
Current.user.assigned_inboxes.include? record
end