User Messages Privacy
Description
Since the introduction of user messages, there are different types of messages (public, direct, to group...) that a user could access and could receive. The goal of this design document is to establish what kind of events are readable and writable.
Definitions
Messages have:
- an author (the Sender)
- a target, which can be either a user, a group, a page, a space, a wiki
- scope or visibility, which can be one of:
- everyone (public message)
- followers (private message)
- specific group (group message)
- specific user (direct message)
- messages can be related to another message (reply, not implemented yet)
Not all target-scope combinations are possible. For example, if the target is a specific user, then the message must be direct (the implicit scope is the target user). If the target is a group, then the scope is implicit: group members. If the message is a reply, then the same scope as the original message is suggested, but can be explicitly changed.
Internally, the author is the event.user, the target is the event.stream, and the scope is given by the event.type.
Robert is the message reader.
William is the message writer.
Reading messages
This tries to establish which kind of messages Robert should be able to see.
- Messages written by Robert should always be accessible to him, regardless of the target and scope (sender = xcontext.user)
- Public messages should always be accessible to Robert (scope = everyone)
- "To followers" messages from William should be accessible only if Robert follows William (scope = followers & xcontext.user follows sender)
- "To group" messages should be accessible only if Robert is a member of that group (scope = group & xcontext.user member of target)
- "Direct" messages should be accessible only if the target of the message is Robert (scope = user & xcontext.user = target)
- Messages for a given page/space/wiki should only be visible if Robert has view access to the target entity (filtered a-posteriori, xcontext.user has view access on target)
Writing messages
This tries to establish which kind of messages William should be able to post.
There are different usage scenarios for messages, so there are different sets of rules, configurable from the wiki administration. It might be useful to be able to change these settings from a certain target's settings: from the user profile to reduce the number of visible messages (this requires changing the read filters, not the ruleset), or from the group settings to forbid sending messages to a group (this requires changing the ruleset depending on the target).
There are no enforcements in place yet.
Full Privacy
This ruleset tries to prevent unrequested messages from showing in Robert's message stream; he should see only messages from people that Robert explicitly trusts. William can write a message only if the recipients trust him. Very good at avoiding spam.
- Posting messages to a specific page/space/wiki should only be possible if that entity exists and William has view access to that entity; this rule is an implicit precondition for all the following rules (target exists & xcontext.user has view access on target)
- Public messages are always forbidden (scope != everyone)
- William should be able to write "to followers" messages (scope = followers)
- William should be able to send a group message to a group only if he is a member of that group (scope = group and xcontext.user is member of target); XWikiAllGroup should be somehow excluded in this case
- William should be able to send a direct message to Robert only if both follow each other (scope = user & target follows xcontext.user & xcontext.user follows target)
Silent
This ruleset tries to keep the number of visible messages in Robert's message stream to a minimum, while allowing users to send targeted messages to a third party. William can write a message to specific recipients.
- Posting messages to a specific page/space/wiki should only be possible if that entity exists and William has view access to that entity; this rule is an implicit precondition for all the following rules (target exists & xcontext.user has view access on target)
- Public messages are always forbidden (scope != everyone)
- William should be able to write "to followers" messages (scope = followers)
- William should be able to send a group message to any visible group (scope = group)
- William should be able to send a direct message to Robert (scope = user)
Open
- Posting messages to a specific page/space/wiki should only be possible if that entity exists; this rule is an implicit precondition for all the following rules (target exists)
- Public messages are always allowed (scope = everyone)
- William should be able to write "to followers" messages (scope = followers)
- William should be able to send a group message to any group (scope = group)
- William should be able to send a direct message to Robert (scope = user)
Sergiu Dumitriu