mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-14 06:03:45 +01:00
Update removeUserFromProject to account for token-access
This commit is contained in:
@@ -158,7 +158,11 @@ module.exports = CollaboratorsHandler =
|
||||
logger.log user_id: user_id, project_id: project_id, "removing user"
|
||||
conditions = _id:project_id
|
||||
update = $pull:{}
|
||||
update["$pull"] = collaberator_refs:user_id, readOnly_refs:user_id
|
||||
update["$pull"] =
|
||||
collaberator_refs:user_id,
|
||||
readOnly_refs:user_id
|
||||
tokenAccessReadOnly_refs:user_id
|
||||
tokenAccessReadAndWrite_refs:user_id
|
||||
Project.update conditions, update, (err)->
|
||||
if err?
|
||||
logger.error err: err, "problem removing user from project collaberators"
|
||||
|
||||
@@ -223,7 +223,10 @@ describe "CollaboratorsHandler", ->
|
||||
.calledWith({
|
||||
_id: @project_id
|
||||
}, {
|
||||
"$pull":{collaberator_refs:@user_id, readOnly_refs:@user_id}
|
||||
"$pull":{
|
||||
collaberator_refs:@user_id, readOnly_refs:@user_id,
|
||||
tokenAccessReadOnly_refs:@user_id, tokenAccessReadAndWrite_refs:@user_id
|
||||
}
|
||||
})
|
||||
.should.equal true
|
||||
|
||||
|
||||
Reference in New Issue
Block a user