Messages
) to introduce extremely rich behavior for your apps.plusAppliedList
) and the m-list (or the minusAppliedList
). A given user (also called as an accessor
) can perform an action, if for the action the accessor is a part of at least one selector in the plusAppliedList
and is a part of no selector in the minusAppliedList
. For example, if @john were to send a message only to @candice, his message would have the following ACL:ChatComponent.ts
and modify the sendMessage
function:@
followed by a sequence of alphanumeric characters. This will match any string that starts with a pattern like @john
, @candice
etc.null
. There are two things to note here. First, we specify the identifiers in an ACL string directly; they are not nested inside any identifier
object. This is because Mitter.io ACLs use a custom syntax and are not JSON objects. Second, we have added a read privilege for the sending user as well. When you do not use ACLs, Mitter.io attaches ACLs that allow the user and all the participants in a channel to read the message; but if you decide to use ACLs, then Mitter.io does not perform an operation on the incoming ACLs. So if you did not provide a read message privilege for the user, that message would not be delivered even to the sender.http://localhost:3000/user/@john
, http://localhost:3000/user/@amy
and http://localhost:3000/user/@candice
. Point to the #roadtrip
channel in all three of them. Try sending out message to each other and mentioning a specific user and see what happens. Here's a quick demo of this app in action: