mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-04-27 14:33:59 -04:00
Fixes #566, admin on localhost by default
This commit is contained in:
parent
34983059aa
commit
4db433c062
1 changed files with 2 additions and 1 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue