Copied starter Meteor App files.
Cut and paste of the BasicMeteorApp.
This commit is contained in:
17
imports/api/Roles.js
Normal file
17
imports/api/Roles.js
Normal file
@@ -0,0 +1,17 @@
|
||||
|
||||
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;
|
||||
Reference in New Issue
Block a user