Don't create tokens on project by default

This commit is contained in:
Shane Kilkelly 2017-10-09 10:25:20 +01:00
parent 29a584996f
commit 732ce9417b

View file

@ -6,7 +6,6 @@ logger = require('logger-sharelatex')
sanitize = require('sanitizer') sanitize = require('sanitizer')
concreteObjectId = require('mongoose').Types.ObjectId concreteObjectId = require('mongoose').Types.ObjectId
Errors = require "../Features/Errors/Errors" Errors = require "../Features/Errors/Errors"
ProjectTokenGenerator = require '../Features/Project/ProjectTokenGenerator'
Schema = mongoose.Schema Schema = mongoose.Schema
ObjectId = Schema.ObjectId ObjectId = Schema.ObjectId
@ -34,14 +33,8 @@ ProjectSchema = new Schema
imageName : { type: String } imageName : { type: String }
track_changes : { type: Object } track_changes : { type: Object }
tokens : tokens :
readOnly : { readOnly : { type: String }
type: String, readAndWrite : { type: String }
default: () -> ProjectTokenGenerator.readOnlyToken()
}
readAndWrite : {
type: String,
default: () -> ProjectTokenGenerator.readAndWriteToken()
}
tokenAccessReadOnly_refs : [ type:ObjectId, ref:'User' ] tokenAccessReadOnly_refs : [ type:ObjectId, ref:'User' ]
tokenAccessReadAndWrite_refs : [ type:ObjectId, ref:'User' ] tokenAccessReadAndWrite_refs : [ type:ObjectId, ref:'User' ]
overleaf : overleaf :