diff --git a/services/web/app/coffee/Features/Collaborators/CollaboratorsHandler.coffee b/services/web/app/coffee/Features/Collaborators/CollaboratorsHandler.coffee index 6fab5efe1e..e10ff369ab 100644 --- a/services/web/app/coffee/Features/Collaborators/CollaboratorsHandler.coffee +++ b/services/web/app/coffee/Features/Collaborators/CollaboratorsHandler.coffee @@ -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 } diff --git a/services/web/test/UnitTests/coffee/Collaborators/CollaboratorsHandlerTests.coffee b/services/web/test/UnitTests/coffee/Collaborators/CollaboratorsHandlerTests.coffee index c05299c95e..e688c32d5d 100644 --- a/services/web/test/UnitTests/coffee/Collaborators/CollaboratorsHandlerTests.coffee +++ b/services/web/test/UnitTests/coffee/Collaborators/CollaboratorsHandlerTests.coffee @@ -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'}