如何调试 RocketChat 错误不允许尝试邀请和添加/删除所有者

问题描述

我们通过 Docker 映像 rocketchat/rocket.chat:0.68.4 和 Ruby rocketchat gem 使用 RocketChat。

已经有一些可用的功能来更新频道的属性

# RocketChatService is a wrapper class for a RocketChat::Session object with authentication as admin
channels = RocketChatService.channels

channels.set_attr(name: id,topic: escape_nil(title)) if title_changed?
channels.set_attr(name: id,description: escape_nil(description)) if description_changed?
channels.set_attr(name: id,custom_fields: { project_id: project_id }) if project_id && project_id_was.nil?

但现在我们还需要向房间添加新用户,让他们成为所有者,或降级以前的所有者。以下代码在某些情况下有效(我担心在此处介绍很复杂),但有时会导致错误

# idempotent
channels.invite(name: id,username: creator_id)

# Todo: already an owner
channels.add_owner(name: id,username: creator_id)

channels.remove_owner(name: id,username: creator_id_was)

问题在于这些错误消息的信息量并不大:

"exception"=>"Not allowed [error-not-allowed]"

RocketChat 中没有日志文件,发生这种情况时也没有任何内容写入 stdout。这让我想到了我的问题:如何调试上述错误消息?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)