Chatwoot/app/policies/inbox_policy.rb
Pranav Raj S 60e96f446e [Enhancement] Add CopyToClipboard action in code component (#329)
* Add CopyToClipboard action in websiteWidgetCode component

* Fix codeclimate issues
2019-11-30 17:33:42 +05:30

30 lines
432 B
Ruby

class InboxPolicy < ApplicationPolicy
class Scope
attr_reader :user, :scope
def initialize(user, scope)
@user = user
@scope = scope
end
def resolve
if user.administrator?
scope.all
elsif user.agent?
user.assigned_inboxes
end
end
end
def index?
true
end
def create?
@user.administrator?
end
def destroy?
@user.administrator?
end
end