Fixes , admin on localhost by default

This commit is contained in:
IngridMorstrad 2014-03-16 17:25:19 +05:30
parent 34983059aa
commit 4db433c062

View file

@ -22,6 +22,7 @@ UserSchema.pre('init', (next) ->
UserSchema.post('init', ->
@set('anonymous', false) if @get('email')
@currentSubscriptions = JSON.stringify(@get('emailSubscriptions'))
@set('permissions', ['admin']) if not isProduction
)
UserSchema.methods.isAdmin = ->
@ -90,4 +91,4 @@ UserSchema.statics.hashPassword = (password) ->
shasum.update(salt + password)
shasum.digest('hex')
module.exports = User = mongoose.model('User', UserSchema)
module.exports = User = mongoose.model('User', UserSchema)