How to grant the permission at room?

Hi, all.

I create a MUC room in my openfire server. I can login with a user name and join in the room and send messages to the room, and I can also login with a anonymous user and join the room and send a message to the room.

Now I want to control the permission: I only grant the send_message_permission to a specific login user, and the anonymous use can’t send message to room(but it can see the message sent by ganted user).

So how to enable this feature? Or how to create such room? Will anybody paste me the create room code?

Thanks a lot.

Create a moderated room. In a moderated room only moderator, members and paticipants have the voice privilege, guests have to request the voice privilege if they want to speak to all other occupants (see XEP-0045: Roles and Affiliations).