diff --git a/server/users/User.coffee b/server/users/User.coffee index 29d0d0a1f..7b9669ee2 100644 --- a/server/users/User.coffee +++ b/server/users/User.coffee @@ -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 = ->