From b7d226f43476c0db8bed936b4474fcef76994a34 Mon Sep 17 00:00:00 2001 From: James Allen Date: Tue, 15 Mar 2016 14:39:27 +0000 Subject: [PATCH] Make privilege level check in EditorHttpController more explicit --- .../web/app/coffee/Features/Editor/EditorHttpController.coffee | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/services/web/app/coffee/Features/Editor/EditorHttpController.coffee b/services/web/app/coffee/Features/Editor/EditorHttpController.coffee index ab252472bd..ebe1351110 100644 --- a/services/web/app/coffee/Features/Editor/EditorHttpController.coffee +++ b/services/web/app/coffee/Features/Editor/EditorHttpController.coffee @@ -9,6 +9,7 @@ AuthorizationManager = require("../Authorization/AuthorizationManager") ProjectEditorHandler = require('../Project/ProjectEditorHandler') Metrics = require('../../infrastructure/Metrics') CollaboratorsHandler = require("../Collaborators/CollaboratorsHandler") +PrivilegeLevels = require "../Authorization/PrivilegeLevels" module.exports = EditorHttpController = joinProject: (req, res, next) -> @@ -36,7 +37,7 @@ module.exports = EditorHttpController = return callback(error) if error? AuthorizationManager.getPrivilegeLevelForProject user_id, project_id, (error, privilegeLevel) -> return callback(error) if error? - if !privilegeLevel + if !privilegeLevel? or privilegeLevel == PrivilegeLevels.NONE callback null, null, false else callback(null,