mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-23 23:58:02 -05:00
User now set to admin at signup instead of login
This commit is contained in:
parent
8d9a8aaf73
commit
37e3cd65da
1 changed files with 1 additions and 1 deletions
|
@ -16,13 +16,13 @@ UserSchema.pre('init', (next) ->
|
|||
return next() unless jsonschema.properties?
|
||||
for prop, sch of jsonschema.properties
|
||||
@set(prop, sch.default) if sch.default?
|
||||
@set('permissions', ['admin']) if not isProduction
|
||||
next()
|
||||
)
|
||||
|
||||
UserSchema.post('init', ->
|
||||
@set('anonymous', false) if @get('email')
|
||||
@currentSubscriptions = JSON.stringify(@get('emailSubscriptions'))
|
||||
@set('permissions', ['admin']) if not isProduction
|
||||
)
|
||||
|
||||
UserSchema.methods.isAdmin = ->
|
||||
|
|
Loading…
Reference in a new issue