Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to Add User A to Given MUC created by another User B #4359

Open
mahmadmujtaba opened this issue Aug 19, 2024 · 0 comments
Open

How to Add User A to Given MUC created by another User B #4359

mahmadmujtaba opened this issue Aug 19, 2024 · 0 comments

Comments

@mahmadmujtaba
Copy link

mahmadmujtaba commented Aug 19, 2024

MongooseIM version: 6.2.1

Installed from: Official Docker

Erlang/OTP version: 25

Not able to modify User Affiliation to a MUC.
Steps to reproduce:

Create a Users A, B: (OK) as Admin User
mutation register_user {
	account {
		registerUser(
			domain: "DOMAIN"
			password: "PASSWORD"
			username: "USER-A/USER-B"
		) {
			jid
			message
		}
	}
}
Create a MUC: (OK) as User B
mutation create_room {
  muc {
    createInstantRoom(
      nick: "USERNICK",
      room: "[email protected]"
    ) {
      jid
      title
      private
      usersNumber
    }
  }
}
Update MUC properties: (OK) as User B
mutation change_room_configuration {
	muc {
		changeRoomConfiguration(
			room: "[email protected]"
			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
		}
	}
}
Add User A to MUC with Affiliation as MEMBER: (NOT WORKING)
# called from GraphiQL with auth of User B within Request params (DOES NOT WORK)
# called from GraphiQL with auth of Admin within Request params (DOES NOT WORK)
mutation muc {
  muc {
    setUserAffiliation(
      affiliation: MEMBER,
      room: "[email protected]",
      user: "user-a@localhost"
    )
  }
}

Error details:

{
  "errors": [
    {
      "path": [
        "muc",
        "setUserAffiliation"
      ],
      "message": "Given user does not have permission to set the member affiliation",
      "extensions": {
        "room": "[email protected]",
        "code": "not_allowed"
      }
    }
  ],
  "data": {
    "muc": {
      "setUserAffiliation": null
    }
  }
}
@mahmadmujtaba mahmadmujtaba changed the title How to Add User X to Given MUC created by another User Y How to Add User A to Given MUC created by another User B Aug 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant