Преглед изворни кода

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) ->) ->