1
0
Fork 0
mirror of https://github.com/overleaf/overleaf.git synced 2025-04-08 13:21:56 +00:00

Add an 'owner' source tag, for the project owner

This commit is contained in:
Shane Kilkelly 2017-09-21 09:35:25 +01:00
parent ef7e1ceabf
commit 931ba56e33
2 changed files with 3 additions and 2 deletions
services/web
app/coffee/Features/Collaborators
test/UnitTests/coffee/Collaborators

View file

@ -13,6 +13,7 @@ ProjectEditorHandler = require "../Project/ProjectEditorHandler"
Sources =
INVITE: 'invite'
TOKEN: 'token'
OWNER: 'owner'
module.exports = CollaboratorsHandler =
@ -22,7 +23,7 @@ module.exports = CollaboratorsHandler =
return callback new Errors.NotFoundError("no project found with id #{project_id}") if !project?
members = []
# Project owner
members.push { id: project.owner_ref.toString(), privilegeLevel: PrivilegeLevels.OWNER }
members.push { id: project.owner_ref.toString(), privilegeLevel: PrivilegeLevels.OWNER, source: Sources.OWNER }
# Invited members
for member_id in project.readOnly_refs or []
members.push { id: member_id.toString(), privilegeLevel: PrivilegeLevels.READ_ONLY, source: Sources.INVITE }

View file

@ -40,7 +40,7 @@ describe "CollaboratorsHandler", ->
it "should return an array of member ids with their privilege levels", ->
@callback
.calledWith(null, [
{ id: "owner-ref", privilegeLevel: "owner" }
{ id: "owner-ref", privilegeLevel: "owner", source: 'owner'}
{ id: "read-only-ref-1", privilegeLevel: "readOnly", source: 'invite'}
{ id: "read-only-ref-2", privilegeLevel: "readOnly", source: 'invite'}
{ id: "read-write-ref-1", privilegeLevel: "readAndWrite", source: 'invite'}