<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE rfc [
  <!ENTITY nbsp    "&#160;">
  <!ENTITY zwsp   "&#8203;">
  <!ENTITY nbhy   "&#8209;">
  <!ENTITY wj     "&#8288;">
]>
<?xml-stylesheet type="text/xsl" href="rfc2629.xslt" ?>
<!-- generated by https://github.com/cabo/kramdown-rfc version 1.7.17 (Ruby 3.3.2) -->
<rfc xmlns:xi="http://www.w3.org/2001/XInclude" ipr="trust200902" docName="draft-mahy-mimi-room-policy-00" category="info" consensus="true" submissionType="IETF" tocInclude="true" sortRefs="true" symRefs="true" version="3">
  <!-- xml2rfc v2v3 conversion 3.22.0 -->
  <front>
    <title abbrev="MIMI Room Policy">Room Policy for the More Instant Messaging Interoperability (MIMI) Protocol</title>
    <seriesInfo name="Internet-Draft" value="draft-mahy-mimi-room-policy-00"/>
    <author fullname="Rohan Mahy">
      <organization>Rohan Mahy Consulting Services</organization>
      <address>
        <email>rohan.ietf@gmail.com</email>
      </address>
    </author>
    <date year="2024" month="July" day="08"/>
    <area>ART</area>
    <workgroup>MIMI WG</workgroup>
    <keyword>room policy</keyword>
    <abstract>
      <?line 35?>

<t>This document describes a set of concrete room policies for the
More Instant Messaging Interoperability (MIMI) Working Group. It describes
several independent properties and policy attributes which can be combined
to model a wide range of chat and multimedia conference types.</t>
    </abstract>
    <note removeInRFC="true">
      <name>About This Document</name>
      <t>
        The latest revision of this draft can be found at <eref target="https://rohanmahy.github.io/mimi-room-policy/draft-mahy-mimi-room-policy.html"/>.
        Status information for this document may be found at <eref target="https://datatracker.ietf.org/doc/draft-mahy-mimi-room-policy/"/>.
      </t>
      <t>
        Discussion of this document takes place on the
        MIMI WG Working Group mailing list (<eref target="mailto:mimi@ietf.org"/>),
        which is archived at <eref target="https://mailarchive.ietf.org/arch/browse/mimi/"/>.
        Subscribe at <eref target="https://www.ietf.org/mailman/listinfo/mimi/"/>.
      </t>
      <t>Source for this draft and an issue tracker can be found at
        <eref target="https://github.com/rohanmahy/mimi-room-policy"/>.</t>
    </note>
  </front>
  <middle>
    <?line 42?>

<section anchor="introduction">
      <name>Introduction</name>
      <t>The MIMI architecture <xref target="I-D.ietf-mimi-arch"/> describes how each room
has an associated policy. Providers offer a "policy envelope"
of supported and allowed policy settings, from which the creator of a room
selects a specific room policy. The room policy might further allow
individual participants to make specific choices (for example, allowing
but not requiring read-message notifications), while constraining other
choices (for example, prohibiting self-deleting messages). Individual
users can examine the room policy to determine if it is consistent with
policies they accept either before or immediately on joining a room.
<xref section="4.4" sectionFormat="of" target="I-D.ietf-mimi-arch"/></t>
      <t>Making rooms interoperable across existing clients is challenging, as rooms
and clients can support different policies and capabilities across vendors
and providers. Our goal is to balance the policy and authorization goals of
the room with the policy and authorization goals of the end user, so we can support a broad range of vendors and providers.</t>
      <t>Each room is owned by one provider at a time. The owning provider controls the range of acceptable policies. The user responsible for the room can further choose among the acceptable policies. Users (regardless if on other providers) can either accept the policies of the room or not. However we want to make it as easy as possible for clients from other providers to comply with the room policy primitives without enumerating specific features or requiring all clients implementations to present an identical user experience.</t>
      <t>Configurable Role-based access control with permissions. An example
scheme is described in the Appendix.</t>
    </section>
    <section anchor="conventions-and-definitions">
      <name>Conventions and Definitions</name>
      <t>The key words "<bcp14>MUST</bcp14>", "<bcp14>MUST NOT</bcp14>", "<bcp14>REQUIRED</bcp14>", "<bcp14>SHALL</bcp14>", "<bcp14>SHALL
NOT</bcp14>", "<bcp14>SHOULD</bcp14>", "<bcp14>SHOULD NOT</bcp14>", "<bcp14>RECOMMENDED</bcp14>", "<bcp14>NOT RECOMMENDED</bcp14>",
"<bcp14>MAY</bcp14>", and "<bcp14>OPTIONAL</bcp14>" in this document are to be interpreted as
described in BCP 14 <xref target="RFC2119"/> <xref target="RFC8174"/> when, and only when, they
appear in all capitals, as shown here.</t>
      <?line -18?>

<t>Role:
A long-lived position reflecting the privilege level of a participant in a room. Possible values are owner, admin, regular-user, visitor, none, or outcast. A role closely maps to the MUC concept of affiliation, not the MUC concept of role.</t>
      <t>Occupant:
A user that has at least one client in the corresponding MLS group, and a role of owner, admin, regular-user, or visitor.</t>
      <t>Room ID:
An identifier which uniquely identifies a room.</t>
      <t>User ID:
An internal identifier which uniquely identifies a user.</t>
      <t>Nickname:
The identifier by which a user is referred inside a room. Depending on the context it may be a display name, handle, pseudonym, or temporary identifier. The nickname in one room need not correlate with the nickname for the same user in a different room.</t>
      <t>Client ID:
An internal identifier which uniquely identifies one client/device instance of one user account.</t>
      <t><strong>Persistent vs. Temporary rooms</strong>:
A temporary room is destroyed when the last occupant exits whereas a persistent room is not destroyed when the last occupant exist. As MLS has no notion of a group with no members, a persistent room could consist of a sequence of distinct MLS groups, zero or one of which would exist at a time.</t>
      <section anchor="moderation-terms">
        <name>Moderation Terms</name>
        <t>Knock:
To request entry into a room.</t>
        <t>Ban:
To remove a user from a room such that the user is not allowed to re-enter the room (until and unless the ban has been removed). A banned user has a role of "outcast". Typically this action is only used in an open or semi-open room. It is distinct than merely removing a user from an administered group.</t>
        <t>Kick:
To temporarily remove a participant or visitor from a room. The user is allowed to re-enter the room at any time.</t>
        <t>Voice (noun):
The privilege to send messages in a room.</t>
        <t>Revoke Voice:
To remove the permission to send messages in a room.</t>
        <t>Grant Voice:
To grant the permission to send messages in a room.</t>
        <t>Moderator:
A client whose user has a role of admin or owner in the room. A moderator can ban users, and (when allowed in the room) can grant and revoke voice, kick individual clients, and grant access (ex: in response to a knock).</t>
      </section>
    </section>
    <section anchor="room-capabilities">
      <name>Room Capabilities</name>
      <t>Membership-Style:
The overall approach of membership authorization in a room, which could be open, members-only (administrated), fixed-membership, or parent-dependent.</t>
      <t>Open room:
An open room can be joined by any non-banned user.</t>
      <t>Members-Only room:
A members-only room can only be joined by a user in the occupant list,
or who is pre-authorized. Authorized users can add or remove users to the
room. In an enterprise context, it is also common (but not required) for
users from a particular domain, group, or workgroup to be pre-authorized to
add themselves to a Members-Only room.</t>
      <t>Fixed-Membership room:
Fixed-membership rooms have the list of occupants specified when they are created. Other users cannot be added. Occupants cannot leave or be removed, however a user can remove all its clients from the associated MLS group. The most common case of a fixed-membership room is a 1:1 conversation. This room membership style is used to implement Direct Message (DM) and Group DM features. Only a single fixed-membership room can exist for any unique set of occupants.</t>
      <t>Parent-dependent room:
In a parent-dependent room, the list occupants of the room must be a strict subset of the occupants of the parent room. If a user leaves or is removed from the parent room, that user is automatically removed from any parent-dependent rooms of that parent.</t>
      <t>Multi-device vs. Single-device:
A multi-device room can have multiple simultaneous clients of the same user as participants in the room. A single-device room can have a maximum of one client per user in the room at any moment.</t>
      <t>Knock-Enabled vs. Knock-Disabled:
In a knock-enabled room, non-banned users are allowed to programmatically request entry into the room. In a knock-disabled room this functionality is disabled.</t>
      <t>Moderated vs. Unmoderated:
An an unmoderated room, any occupant can send messages to the room. In a moderated room, only occupants who have "voice" can send messages to the room.</t>
    </section>
    <section anchor="room-policy-format-syntax">
      <name>Room policy format syntax</name>
      <section anchor="membership-related-policy">
        <name>Membership-related policy</name>
        <t>The <tt>membership_style</tt> of a room can be one of the following values:</t>
        <ul spacing="normal">
          <li>
            <t>open</t>
          </li>
          <li>
            <t>members-only (default)</t>
          </li>
          <li>
            <t>fixed-membership</t>
          </li>
          <li>
            <t>parent-dependent</t>
          </li>
        </ul>
        <artwork><![CDATA[
enum {
  reserved(0)
  open(1),
  members-only(2),
  fixed-membership(3),
  parent-dependent(4),
  (255)
} MembershipStyle;
]]></artwork>
        <t>An open room allows any unbanned user. A members-only room allows only
invited or preauthorized users to join. A fixed-membership room (which can
be used for DMs or Group DMs) has a list of authorized users set at creation
time that cannot be added to. A parent-dependent room always has a strict subset of the participants of its parent room.</t>
        <t>If the membership_style is <tt>parent-dependent</tt> the <tt>parent_room_uri</tt> <bcp14>MUST</bcp14> be set with the room ID of the parent. Otherwise the field is zero-length.</t>
        <t>If <tt>multi_device</tt> is true (the default), the MLS group may contain multiple clients per user. If false only a single client can be an MLS member at one time.</t>
        <t>If <tt>knock_allowed</tt> is true, a non-participant can send a knock requesting access to the target room. If false, a user cannot. This option can only be enabled if the membership_style is members-only. The default is false.</t>
        <t>If <tt>moderated</tt> is true, the room supports granting and revoking voice. The default is false.</t>
        <artwork><![CDATA[
enum {
  false(0),
  true(1)
} bool;

struct {
  MembershipStyle membership_style;
  Uri parent_room_uri<V>;
  bool multi_device;
  bool knock_allowed;
  bool moderated;
  bool persistent_room;
  bool password_protected;
  ...
} RoomPolicy;
]]></artwork>
        <t>If persistent_room is false, the room will be automatically deleted when the corresponding MLS group is destroyed (when there are no clients in the group). If persistent_room is true, the room policy will remain and a client whose user has appropriate authorization can create a new MLS group for the same room. (There is not a 1:1 correlation of MLS group to room ID in a persistent room.)</t>
        <t>If password_protected is true, the room requires a passcode or passphrase when a client of a new user requests access to the GroupInfo used to join a group. The default is false.</t>
      </section>
      <section anchor="pre-authorized-users">
        <name>Pre-authorized users</name>
        <artwork><![CDATA[
enum {
  reserved(0),
  system(1),
  owner(2),
  admin(3),
  regular_user(4),
  visitor(5),
  banned(6),
  (255)
} Role;

struct {
  Role target_role;
  /* preauth_domain consists of ASCII letters, digits, and hyphens */
  opaque preauth_domain<V>;
  /* the remaining fields are in the form of a URI */
  opaque preauth_workgroup<V>;
  opaque preauth_group<V>;
  opaque preauth_user<V>;
} PreAuthPerRoleList;

struct {
  ...
  PreAuthPerRoleList pre_auth_list<V>;
  ...
} RoomPolicy;
]]></artwork>
        <t>In members-only rooms, it is convenient to pre-authorize specific users--or users from specific domains, workgroups/teams, and groups--to specific roles. The workgroup, group, and user are expressed as a Uri. The domain is expressed in US-ASCII letters, digits, and hyphens only. If the domain is internationalized, the Internationalized Domain Names <xref target="RFC5890"/> conversion <bcp14>MUST</bcp14> be done before filling in this value.</t>
        <t>Note that the system role is used to authorize external proposals for operations for other users. For example, the system role can be used to authorize a provider to remove clients from groups when the corresponding user account is deleted.</t>
      </section>
      <section anchor="delivery-and-read-notifications-pseudonyms">
        <name>Delivery and Read notifications, Pseudonyms</name>
        <artwork><![CDATA[
enum {
  optional(0),
  required(1),
  forbidden(2)
} Optionality;

struct {
  ...
  Optionality delivery_notifications;
  Optionality read_receipts;
  bool pseudonymous_ids;
  ...
} RoomPolicy;
]]></artwork>
        <t>The delivery_notifications value can be set to "forbidden", "optional", or "required". If the value is set to "optional", the client uses its local configuration to determine if it should send delivery notifications in the group.</t>
        <t>The read_receipts value can be set to "forbidden", "optional", or "required". If the value is set to "optional", the client uses its local configuration to determine if it should send read receipts in the group.</t>
        <t>The format for delivery notifications and read receipts is described in Section 5.12 of <xref target="I-D.ietf-mimi-content"/>.</t>
        <t>If pseudonymous_ids is true, clients in the MLS group are free to use pseudonymous identifiers in their MLS credentials. Otherwise the policy of the room is that "real" long-term identifiers are required in MLS credentials in the room's corresponding MLS group.</t>
      </section>
      <section anchor="link-logging-history-and-bot-policies">
        <name>Link, Logging, History, and Bot policies</name>
        <sourcecode type="tls"><![CDATA[
struct {
  bool on_request;
  Uri join_link;
  bool multiuser;
  uint32 expiration;
  Uri link_requests;
} LinkPolicy;

struct {
  Optionality logging;
  Uri logging_clients<V>;
  Uri machine_readable_policy;
  Uri human_readable_policy;
} LoggingPolicy;

struct {
  Optionality history_sharing;
  Role who_can_share<V>;
  bool automatically_share;
  uint32 max_time_period;
} HistoryPolicy;

struct {
  opaque name<V>;
  opaque description<V>;
  Uri homepage;
  Role bot_role;
  bool can_read;
  bool can_write;
  bool can_target_message_in_group;
  bool per_user_content;
} Bot;

struct {
  ...
  bool discoverable;
  LinkPolicy link_policy;
  LoggingPolicy logging_policy;
  HistoryPolicy history_sharing;
  Bot allowed_bots<V>;
  ...
} RoomPolicy;
]]></sourcecode>
        <section anchor="link-policies">
          <name>Link policies</name>
          <t>If discoverable is true, the room is searchable. Presumably this means the the only way to join the room in a client user interface is to be added by an administrator or to use a joining link.
Inside the LinkPolicy are several fields that describe the behavior of links.If the on_request field is true, no joining link will be provided in the room policy; the client will need to fetch a joining link out-of-band or generate a valid one for itself. If present, the URI in link_requests can be used by the client to request an invite code. The value of join_link is empty and the other fields are ignored.If the on_request field is false, the join_link field will contain a joining link. If the link will work for multiple users, multiuser is true. The expiration field represents the time, in seconds after the start of the UNIX epoch (1-January-1970) when the link will expire. The link_requests field can be empty.</t>
        </section>
        <section anchor="logging-policies">
          <name>Logging policies</name>
          <t>Inside the LoggingPolicy, the logging field can be forbidden, optional, or required. If logging is forbidden then the other fields are empty. If logging is required, the list of logging_clients needs to contain at least one logging URI. Each provider should have no more than one logging client at a time in a room. The machine_readable_policy and human_readable_policy fields optionally contain pointers to the owning provider's machine readable and human readable logging policies, respectively. If logging is optional and there is at least one logging_client then logging is active for the room.</t>
        </section>
        <section anchor="chat-history-policies">
          <name>Chat history policies</name>
          <t>Inside the HistoryPolicy, if history_sharing is forbidden, this means that clients (including bots) are expected to not to share chat history with new joiners, in which case who_can_share is empty, automatically_share is false, and max_time_period is zero.
Otherwise who_can_share is a list of roles that are authorized to share history (for example, only admins and owners can share). The values of none and outcast cannot be used in who_can_share. If automatically_share is true, clients can share history with new joiners without user initiation. The history that is shared is limited to max_time_period seconds worth of history.</t>
        </section>
        <section anchor="chat-bot-policies">
          <name>Chat bot policies</name>
          <t>Inside the RoomPolicy there is a list of allowed_bots. Each of which has several fields. The name, description, and homepage are merely descriptive. The bot_role indicates if the chat bot would be treated as a system-user, owner, admin, regular_user, or visitor.
The can_read and can_write fields indicate if the chat bot is allowed to read messages or send messages in the MLS group, respectively. If can_target_message_in_group is true it indicates that the chat bot can send an MLS targeted message (see Section 2.2 of [I-D.ietf-mls-extensions]) or use a different conversation or out-of-band channel to send a message to specific individual users in the room. If per_user_content is true, the chat bot is allowed to send messages with distinct content to each member. (For example a poker bot could deal a different hand to each user in a chat).Users could set policies to reject or leave groups with bots rights that are inconsistent with the user's privacy goals.</t>
        </section>
      </section>
      <section anchor="extensibility-of-the-policy-format">
        <name>Extensibility of the policy format</name>
        <t>Finally, The extensibility mechanism allows for future addition of new room policies.</t>
        <artwork><![CDATA[
enum {
  null(0),
  boolean(1),
  number(2),
  string(3),
  jsonObject(4)
} ExtType;

struct {
  opaque name<V>;
  ExtType type;
  opaque value<V>;
} PolicyExtension;

struct {
  ...
  PolicyExtension policy_extensions<V>;
} RoomPolicy;
]]></artwork>
        <t>foo</t>
      </section>
    </section>
    <section anchor="role-based-access-control">
      <name>Role-Based Access Control</name>
      <t>Permissions</t>
      <ul spacing="normal">
        <li>
          <t>canSendMessage</t>
        </li>
        <li>
          <t>canAddParticipant</t>
        </li>
        <li>
          <t>canRemoveParticipant</t>
        </li>
        <li>
          <t>canRemoveSelf</t>
        </li>
        <li>
          <t>canReport</t>
        </li>
        <li>
          <t>canBanish</t>
        </li>
        <li>
          <t>canUnBanish</t>
        </li>
        <li>
          <t>canKick</t>
        </li>
        <li>
          <t>canRevokeVoice</t>
        </li>
        <li>
          <t>canGrantVoice</t>
        </li>
        <li>
          <t>canChangeRoomName,Subject,Avatar</t>
        </li>
        <li>
          <t>canChangeOwnName,Presence,Mood,Avatar</t>
        </li>
        <li>
          <t>canChangeRoomMembershipStyle</t>
        </li>
        <li>
          <t>canChangeOtherPolicyAttribute</t>
        </li>
        <li>
          <t>canDestroyRoom</t>
        </li>
        <li>
          <t>canCreateJoinLink</t>
        </li>
        <li>
          <t>canKnock</t>
        </li>
        <li>
          <t>canAcceptKnock</t>
        </li>
        <li>
          <t>MLS specific
          </t>
          <ul spacing="normal">
            <li>
              <t>update</t>
            </li>
            <li>
              <t>reinit</t>
            </li>
            <li>
              <t>PSK</t>
            </li>
            <li>
              <t>external proposal</t>
            </li>
            <li>
              <t>external commit</t>
            </li>
          </ul>
        </li>
      </ul>
    </section>
    <section anchor="security-considerations">
      <name>Security Considerations</name>
      <t>TODO Security</t>
    </section>
    <section anchor="iana-considerations">
      <name>IANA Considerations</name>
      <t>This document has no IANA actions.</t>
    </section>
  </middle>
  <back>
    <references>
      <name>References</name>
      <references anchor="sec-normative-references">
        <name>Normative References</name>
        <reference anchor="I-D.ietf-mimi-arch">
          <front>
            <title>An Architecture for More Instant Messaging Interoperability (MIMI)</title>
            <author fullname="Richard Barnes" initials="R." surname="Barnes">
              <organization>Cisco</organization>
            </author>
            <date day="2" month="April" year="2024"/>
            <abstract>
              <t>   The More Instant Messaging Interoperability (MIMI) working group is
   defining a suite of protocols that allow messaging providers to
   interoperate with one another.  This document lays out an overall
   architecture enumerating the MIMI protocols and how they work
   together to enable an overall messaging experience.

              </t>
            </abstract>
          </front>
          <seriesInfo name="Internet-Draft" value="draft-ietf-mimi-arch-00"/>
        </reference>
        <reference anchor="RFC2119">
          <front>
            <title>Key words for use in RFCs to Indicate Requirement Levels</title>
            <author fullname="S. Bradner" initials="S." surname="Bradner"/>
            <date month="March" year="1997"/>
            <abstract>
              <t>In many standards track documents several words are used to signify the requirements in the specification. These words are often capitalized. This document defines these words as they should be interpreted in IETF documents. This document specifies an Internet Best Current Practices for the Internet Community, and requests discussion and suggestions for improvements.</t>
            </abstract>
          </front>
          <seriesInfo name="BCP" value="14"/>
          <seriesInfo name="RFC" value="2119"/>
          <seriesInfo name="DOI" value="10.17487/RFC2119"/>
        </reference>
        <reference anchor="RFC8174">
          <front>
            <title>Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words</title>
            <author fullname="B. Leiba" initials="B." surname="Leiba"/>
            <date month="May" year="2017"/>
            <abstract>
              <t>RFC 2119 specifies common key words that may be used in protocol specifications. This document aims to reduce the ambiguity by clarifying that only UPPERCASE usage of the key words have the defined special meanings.</t>
            </abstract>
          </front>
          <seriesInfo name="BCP" value="14"/>
          <seriesInfo name="RFC" value="8174"/>
          <seriesInfo name="DOI" value="10.17487/RFC8174"/>
        </reference>
        <reference anchor="RFC5890">
          <front>
            <title>Internationalized Domain Names for Applications (IDNA): Definitions and Document Framework</title>
            <author fullname="J. Klensin" initials="J." surname="Klensin"/>
            <date month="August" year="2010"/>
            <abstract>
              <t>This document is one of a collection that, together, describe the protocol and usage context for a revision of Internationalized Domain Names for Applications (IDNA), superseding the earlier version. It describes the document collection and provides definitions and other material that are common to the set. [STANDARDS-TRACK]</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="5890"/>
          <seriesInfo name="DOI" value="10.17487/RFC5890"/>
        </reference>
      </references>
      <references anchor="sec-informative-references">
        <name>Informative References</name>
        <reference anchor="I-D.ietf-mimi-content">
          <front>
            <title>More Instant Messaging Interoperability (MIMI) message content</title>
            <author fullname="Rohan Mahy" initials="R." surname="Mahy">
              <organization>Rohan Mahy Consulting Services</organization>
            </author>
            <date day="10" month="June" year="2024"/>
            <abstract>
              <t>   This document describes content semantics common in Instant Messaging
   (IM) systems and describes a profile suitable for instant messaging
   interoperability of messages end-to-end encrypted inside the MLS
   (Message Layer Security) Protocol.

              </t>
            </abstract>
          </front>
          <seriesInfo name="Internet-Draft" value="draft-ietf-mimi-content-04"/>
        </reference>
      </references>
    </references>
    <?line 414?>

<section anchor="complete-tls-presentation-language-syntax">
      <name>Complete TLS Presentation Language Syntax</name>
      <artwork><![CDATA[
enum {
  false(0),
  true(1)
} bool;

struct {
  /* a valid Uniform Resource Identifier (URI) */
  opaque uri<V>;
} Uri;

enum {
  optional(0),
  required(1),
  forbidden(2)
} Optionality;

enum {
  reserved(0),
  system(1),
  owner(2),
  admin(3),
  regular_user(4),
  visitor(5),
  banned(6),
  (255)
} Role;

struct {
  Role target_role;
  /* preauth_domain consists of ASCII letters, digits, and hyphens */
  opaque preauth_domain<V>;
  /* the remaining fields are in the form of a URI */
  opaque preauth_workgroup<V>;
  opaque preauth_group<V>;
  opaque preauth_user<V>;
} PreAuthPerRoleList;

enum {
  reserved(0)
  open(1),
  members-only(2),
  fixed-membership(3),
  parent-dependent(4),
  (255)
} MembershipStyle;

struct {
  Optionality logging;
  bool enabled;
  Uri logging_clients<V>;
  Uri machine_readable_policy;
  Uri human_readable_policy;
} LoggingPolicy;

struct {
  bool on_request;
  Uri join_link;
  bool multiuser;
  uint32 expiration;
  Uri link_requests;
} LinkPolicy;

struct {
  opaque name<V>;
  opaque description<V>;
  Uri homepage;
  Role bot_role;
  bool can_read;
  bool can_write;
  bool can_target_message_in_group;
  bool per_user_content;
} Bot;

struct {
  Optionality history_sharing;
  Role who_can_share<V>;
  bool automatically_share;
  uint32 max_time_period;
} HistoryPolicy;

enum {
  null(0),
  boolean(1),
  number(2),
  string(3),
  jsonObject(4)
} ExtType;

struct {
  opaque name<V>;
  ExtType type;
  opaque value<V>;
} PolicyExtension;

struct {
  MembershipStyle membership_style;
  bool multi_device;
  bool knock_allowed;
  bool moderated;
  bool password_protected;
  PreAuthPerRoleList pre_auth_list<V>;
  Uri parent_room_uri;
  bool persistent_room;
  Optionality delivery_notifications;
  Optionality read_receipts;
  bool semi_anonymous_ids;
  bool discoverable;
  LinkPolicy link_policy;
  LoggingPolicy logging_policy;
  HistoryPolicy history_sharing;
  Bot allowed_bots<V>;
  PolicyExtension policy_extensions<V>;
} RoomPolicy;

RoomPolicy room_policy;
]]></artwork>
    </section>
    <section anchor="example-roles-and-permissions-scheme">
      <name>Example Roles and Permissions scheme</name>
      <ul spacing="normal">
        <li>
          <t>Owner</t>
        </li>
        <li>
          <t>Admin</t>
        </li>
        <li>
          <t>Moderator</t>
        </li>
        <li>
          <t>Ordinary-user</t>
        </li>
        <li>
          <t>Guest</t>
        </li>
      </ul>
    </section>
    <section numbered="false" anchor="acknowledgments">
      <name>Acknowledgments</name>
      <t>TODO acknowledge.</t>
    </section>
  </back>
  <!-- ##markdown-source:
H4sIAAAAAAAAA+1bbXPbRpL+jl8xp3xYykVSsePsJkouWdlyEm0sSydZu7e1
tUUPiaGIGMRwMYBkxuX8lvst98uun+6ZwQCiHO9WqrKpug+JRWBeevr16Z7G
ZDLJmqIpzaHau7B2rc5tWSy2amlr1ayMOrW1USeVa3TVqFPjnL4uqmt60pja
bkyt50VZNFs1Oj05PdlX57Vt7MKWe5mez2tzQ6vihUqW3ssWujHXtt4eqqJa
2izL7aLSa6Igr/Wymaz1ajtZF+tiUtOsyYZnTT7+OHPtfF04V9iq2W5o+Mmz
l98o9ZHSpbO0UVHlZmPof1WzN1Z7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