如何用MongooseIM GraphQL API更新用户MUC房间附属关系?权限问题求助
MongooseIM 6.2.1 无法修改MUC房间用户附属关系问题
环境信息
- MongooseIM版本:6.2.1
- 安装来源:官方Docker镜像
- Erlang/OTP版本:25
复现步骤
- 以管理员身份创建用户A、B(操作成功)
mutation register_user { account { registerUser( domain: "DOMAIN" password: "PASSWORD" username: "USER-A/USER-B" ) { jid message } } }
- 以用户B身份创建MUC房间(操作成功)
mutation create_room { muc { createInstantRoom( nick: "USERNICK", room: "ROOM_NAME@group.host" ) { jid title private usersNumber } } }
- 以用户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 } } }
- 将用户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
相关产品推荐
相关产品推荐

