Almost in every meteor method i have these sort of checks:
if (!Meteor.userId()) throw new Meteor.Error('not-authorized')
This goes against DRY principle, and i would like to get rid of it somehow to make code more readable.
By the way, do i need to make this check if i have configured Simple Schema? Like this? -
`Collection.schema = new SimpleSchema({
userId: {
label: 'document userId',
type: String,
regEx: SimpleSchema.RegEx.Id,
autoValue() { if ( this.isInsert ) return this.userId }
}
})`