mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Delete dead code in User model
This commit is contained in:
parent
40048d49a2
commit
b64c8e3d78
1 changed files with 0 additions and 26 deletions
|
@ -55,32 +55,6 @@ UserSchema = new Schema
|
|||
# has this set to true, despite never having had a free trial
|
||||
hadFreeTrial: {type: Boolean, default: false}
|
||||
|
||||
UserSchema.statics.getAllIds = (callback)->
|
||||
this.find {}, ["first_name"], callback
|
||||
|
||||
|
||||
UserSchema.statics.findReadOnlyProjects = (user_id, callback)->
|
||||
@find({'projects.readOnly_refs':user_id}).populate('projects.readOnly_refs').run (err, users)->
|
||||
projects = []
|
||||
_.each users, (user)->
|
||||
_.each user.projects, (project)->
|
||||
_.each project.readOnly_refs, (subUser)->
|
||||
if(subUser._id == user_id)
|
||||
projects.push(project)
|
||||
callback(projects)
|
||||
|
||||
UserSchema.statics.findCollaborationProjects = (user_id, callback)->
|
||||
@find({'projects.collaberator_refs':user_id}).populate('projects.collaberator_refs').run (err, users)->
|
||||
projects = []
|
||||
_.each users, (user)->
|
||||
_.each user.projects, (project)->
|
||||
_.each project.collaberator_refs, (subUser)->
|
||||
if(subUser._id == user_id)
|
||||
projects.push(project)
|
||||
callback(projects)
|
||||
|
||||
|
||||
|
||||
conn = mongoose.createConnection(Settings.mongo.url, server: poolSize: 10)
|
||||
|
||||
User = conn.model('User', UserSchema)
|
||||
|
|
Loading…
Reference in a new issue