Files
AVEF/imports/api/index.js
Wynne Crisman 2593d0f977 Appreciation Editor Complete / All Others Incomplete
The text editor for the appreciation page is complete, but all other files are empty, besides User Manager.
2018-08-17 11:24:00 -07:00

24 lines
786 B
JavaScript

import Users from "./User.js";
import UserRoles from "./Roles.js";
import Pages from "./Page.js";
//Save the collections in the Meteor.collections property for easy access without name conflicts.
Meteor.collections = {Users, UserRoles, Pages};
//If this is the server then setup the default admin user if none exist.
if(Meteor.isServer) {
//Change this to find admin users, create a default admin user if none exists.
if(Users.find({}).count() == 0) {
try {
console.log("Creating a default admin user: admin/admin");
let id = Accounts.createUser({password: 'admin', username: 'admin'});
//Requires the alanning:roles package.
Roles.addUsersToRoles(id, [Meteor.UserRoles.ROLE_MANAGE, Meteor.UserRoles.ROLE_UPDATE]);
}
catch(err) {
console.log(err);
}
}
}