You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何用MongooseIM GraphQL API更新用户MUC房间附属关系?权限问题求助

MongooseIM 6.2.1 无法修改MUC房间用户附属关系问题

环境信息

  • MongooseIM版本:6.2.1
  • 安装来源:官方Docker镜像
  • Erlang/OTP版本:25

复现步骤

  1. 以管理员身份创建用户A、B(操作成功)
mutation register_user {
    account {
        registerUser(
            domain: "DOMAIN"
            password: "PASSWORD"
            username: "USER-A/USER-B"
        ) {
            jid
            message
        }
    }
}
  1. 以用户B身份创建MUC房间(操作成功)
mutation create_room {
  muc {
    createInstantRoom(
      nick: "USERNICK",
      room: "ROOM_NAME@group.host"
    ) {
      jid
      title
      private
      usersNumber
    }
  }
}
  1. 以用户B身份更新MUC房间属性(操作成功)
mutation change_room_configuration {
    muc {
        changeRoomConfiguration(
            room: "_store@group.localhost"
            config: {
                title: "TITLE"
                description: "DESCRIPTION"
                allowChangeSubject: true
                allowQueryUsers: true
                allowPrivateMessages: true
                allowVisitorStatus: true
                allowVisitorNickchange: true
                public: true
                publicList: true
                persistent: true
                moderated: false
                membersByDefault: true
                membersOnly: false
                allowUserInvites: true
                allowMultipleSession: true
                passwordProtected: false
                password: null
                anonymous: false
                mayGetMemberList: ["member"]
                maxUsers: 30
                logging: true
            }
        ) {
            title
            description
            allowChangeSubject
            allowQueryUsers
            allowPrivateMessages
            allowVisitorStatus
            allowVisitorNickchange
            public
            publicList
            persistent
            moderated
            membersByDefault
            membersOnly
            allowUserInvites
            allowMultipleSession
            passwordProtected
            password
            anonymous
            mayGetMemberList
            maxUsers
            logging
        }
    }
}
  1. 将用户A添加到MUC房间并设置附属关系为MEMBER(操作失败)
# 以用户B身份在GraphiQL中调用(失败)
# 以管理员身份在GraphiQL中调用(失败)
mutation muc {
  muc {
    setUserAffiliation(
      affiliation: MEMBER,
      room: "desired-muc@group.localhost",
      user: "user-a@localhost"
    )
  }
}

错误详情

{
  "errors": [
    {
      "path": [
        "muc",
        "setUserAffiliation"
      ],
      "message": "给定用户没有权限设置成员附属关系",
      "extensions": {
        "room": "desired-muc@group.localhost",
        "code": "not_allowed"
      }
    }
  ],
  "data": {
    "muc": {
      "setUserAffiliation": null
    }
  }
}

内容的提问来源于stack exchange,提问作者M Ahmad Mujtaba

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.18 21:53:14