mirror of
https://github.com/vale981/Vulcan
synced 2025-03-06 10:01:40 -05:00
16 lines
No EOL
419 B
JavaScript
16 lines
No EOL
419 B
JavaScript
Categories = new Meteor.Collection('categories');
|
|
|
|
Categories.allow({
|
|
insert: isAdminById
|
|
, update: isAdminById
|
|
, remove: isAdminById
|
|
});
|
|
|
|
Meteor.methods({
|
|
category: function(category){
|
|
if (!Meteor.user() || !isAdmin(Meteor.user()))
|
|
throw new Meteor.Error(i18n.t('You need to login and be an admin to add a new category.'))
|
|
var categoryId=Categories.insert(category);
|
|
return category.name;
|
|
}
|
|
}); |