mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Clean up
This commit is contained in:
parent
b5bed1837e
commit
d386f79a76
1 changed files with 26 additions and 9 deletions
|
@ -30,19 +30,36 @@ module.exports = CollaboratorsHandler =
|
||||||
return callback(error) if error?
|
return callback(error) if error?
|
||||||
return callback new Errors.NotFoundError("no project found with id #{project_id}") if !project?
|
return callback new Errors.NotFoundError("no project found with id #{project_id}") if !project?
|
||||||
members = []
|
members = []
|
||||||
members.push { id: project.owner_ref.toString(), privilegeLevel: PrivilegeLevels.OWNER, source: Sources.OWNER }
|
members.push {
|
||||||
# read-and-write
|
id: project.owner_ref.toString(),
|
||||||
|
privilegeLevel: PrivilegeLevels.OWNER,
|
||||||
|
source: Sources.OWNER
|
||||||
|
}
|
||||||
for member_id in project.collaberator_refs or []
|
for member_id in project.collaberator_refs or []
|
||||||
members.push { id: member_id.toString(), privilegeLevel: PrivilegeLevels.READ_AND_WRITE, source: Sources.INVITE }
|
members.push {
|
||||||
|
id: member_id.toString(),
|
||||||
|
privilegeLevel: PrivilegeLevels.READ_AND_WRITE,
|
||||||
|
source: Sources.INVITE
|
||||||
|
}
|
||||||
|
for member_id in project.readOnly_refs or []
|
||||||
|
members.push {
|
||||||
|
id: member_id.toString(),
|
||||||
|
privilegeLevel: PrivilegeLevels.READ_ONLY,
|
||||||
|
source: Sources.INVITE
|
||||||
|
}
|
||||||
if project.publicAccesLevel == PublicAccessLevels.TOKEN_BASED
|
if project.publicAccesLevel == PublicAccessLevels.TOKEN_BASED
|
||||||
for member_id in project.tokenAccessReadAndWrite_refs or []
|
for member_id in project.tokenAccessReadAndWrite_refs or []
|
||||||
members.push { id: member_id.toString(), privilegeLevel: PrivilegeLevels.READ_AND_WRITE, source: Sources.TOKEN }
|
members.push {
|
||||||
# read-only
|
id: member_id.toString(),
|
||||||
for member_id in project.readOnly_refs or []
|
privilegeLevel: PrivilegeLevels.READ_AND_WRITE,
|
||||||
members.push { id: member_id.toString(), privilegeLevel: PrivilegeLevels.READ_ONLY, source: Sources.INVITE }
|
source: Sources.TOKEN
|
||||||
if project.publicAccesLevel == PublicAccessLevels.TOKEN_BASED
|
}
|
||||||
for member_id in project.tokenAccessReadOnly_refs or []
|
for member_id in project.tokenAccessReadOnly_refs or []
|
||||||
members.push { id: member_id.toString(), privilegeLevel: PrivilegeLevels.READ_ONLY, source: Sources.TOKEN }
|
members.push {
|
||||||
|
id: member_id.toString(),
|
||||||
|
privilegeLevel: PrivilegeLevels.READ_ONLY,
|
||||||
|
source: Sources.TOKEN
|
||||||
|
}
|
||||||
return callback null, members
|
return callback null, members
|
||||||
|
|
||||||
getMemberIds: (project_id, callback = (error, member_ids) ->) ->
|
getMemberIds: (project_id, callback = (error, member_ids) ->) ->
|
||||||
|
|
Loading…
Reference in a new issue