mirror of
https://github.com/overleaf/overleaf.git
synced 2025-01-23 01:23:59 +00:00
Make privilege level check in EditorHttpController more explicit
This commit is contained in:
parent
261466b042
commit
b7d226f434
1 changed files with 2 additions and 1 deletions
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue