view mod_muc_config_restrict/README.markdown @ 4651:8231774f5bfd

mod_cloud_notify_encrypted: Ensure body substring remains valid UTF-8 The `body:sub()` call risks splitting the string in the middle of a multi-byte UTF-8 sequence. This should have been caught by util.stanza validation, but that would have caused some havoc, at the very least causing the notification to not be sent. There have been no reports of this happening. Likely because this module isn't widely deployed among users with languages that use many longer UTF-8 sequences. The util.encodings.utf8.valid() function is O(n) where only the last sequence really needs to be checked, but it's in C and expected to be fast.
author Kim Alvefur <zash@zash.se>
date Sun, 22 Aug 2021 13:22:59 +0200
parents 8de50be756e5
children 34fb3d239ac1
line wrap: on
line source

---
labels:
- 'Stage-Alpha'
summary: Restrict MUC configuration options to server admins
...

Introduction
============

Sometimes, especially on public services, you may want to allow people
to create their own rooms, but prevent some options from being modified
by normal users.

For example, using this module you can prevent users from making rooms
persistent, or making rooms publicly visible.

Details
=======

You need to supply a list of options that will be restricted to admins.
Available options can vary, but the following table lists Prosody's
built-in options (as defined in XEP-0045):

  Name                              Description
  --------------------------------- -------------------------------------------
  muc\#roomconfig\_roomname         The title/name of the room
  muc\#roomconfig\_roomdesc         The description of the room
  muc\#roomconfig\_persistentroom   Whether the room should remain when empty
  muc\#roomconfig\_publicroom       Whether the room is publicly visible
  muc\#roomconfig\_changesubject    Whether occupants can change the subject
  muc\#roomconfig\_whois            Control who can see occupant's real JIDs
  muc\#roomconfig\_roomsecret       The room password
  muc\#roomconfig\_moderatedroom    Whether the room is moderated
  muc\#roomconfig\_membersonly      Whether the room is members-only
  muc\#roomconfig\_historylength    The length of the room history

Some plugins may add other options to the room config (in Prosody
0.10+), for which you will need to consult their documentation for the
full option name.

Configuration
=============

Enable the plugin on a MUC host (do not put it in your global
modules\_enabled list):

``` {.lua}
Component "conference.example.com" "muc"
modules_enabled = { "muc_config_restrict" }
muc_config_restricted = {
  "muc#roomconfig_persistentroom"; -- Prevent non-admins from changing a room's persistence setting
  "muc#roomconfig_membersonly"; -- Prevent non-admins from changing whether rooms are members-only
}
```

Compatibility
=============

  ------- --------------
  trunk   Works
  0.9     Doesn't work
  0.8     Doesn't work
  ------- --------------