|
@@ -123,7 +123,11 @@ module.exports = async (dbName='graphql-chat') => {
|
|
|
if (!this.chat){
|
|
|
throw new ReferenceError("You should set chat")
|
|
|
}
|
|
|
+
|
|
|
const chatId = this.chat._id.toString()
|
|
|
+ if (!chatACL.includes(chatId)) {
|
|
|
+ throw new ReferenceError("You cannot post to chat without membership.")
|
|
|
+ }
|
|
|
|
|
|
this.___permissions.read.push(chatId)
|
|
|
this.___permissions.read = [...new Set(this.___permissions.read)]
|