瀏覽代碼

add comment about fallback case

Brian Gough 10 年之前
父節點
當前提交
8ffec68250
共有 1 個文件被更改,包括 4 次插入 和 1 次删除
  1. 4 1
      services/real-time/app/coffee/WebsocketController.coffee

+ 4 - 1
services/real-time/app/coffee/WebsocketController.coffee

@@ -101,7 +101,10 @@ module.exports = WebsocketController =
 		Utils.getClientAttributes client, ["project_id", "user_id"], (error, {project_id, user_id}) ->
 			logger.log {user_id, project_id, doc_id, client_id: client.id}, "client leaving doc"
 			client.leave doc_id
-			AuthorizationManager.removeAccessToDoc client, doc_id # may not be needed, could block updates?
+			# we could remove permission when user leaves a doc, but because
+			# the connection is per-project, we continue to allow access
+			# after the initial joinDoc since we know they are already authorised.
+			## AuthorizationManager.removeAccessToDoc client, doc_id
 			callback()
 		
 	updateClientPosition: (client, cursorData, callback = (error) ->) ->