
if(Meteor.isServer) {
	Meteor.publish('roles', function() {
		if(Roles.userIsInRole(this.userId, ['manage'])) {
			return Meteor.roles.find({}, {fields: {name: 1}});
		}
		else throw new Meteor.Error(403, "Not authorized to view roles.");
	});
}

let ROLE_MANAGE = "manage";
let ROLE_UPDATE = "update";

Meteor.UserRoles = {ROLE_MANAGE, ROLE_UPDATE};


export default Meteor.roles;