Updated to set system reg policy on first run.

This commit is contained in:
Brian McGonagill 2024-07-27 13:47:46 -05:00
parent de1ca5bace
commit 84dd13d92d
2 changed files with 14 additions and 1 deletions

View file

@ -1,5 +1,5 @@
Accounts.emailTemplates.from = 'no-reply@getmy.org';
Accounts.emailTemplates.siteName = 'Get Myp';
Accounts.emailTemplates.siteName = 'Get My';
Accounts.emailTemplates.verifyEmail = {
subject() {

View file

@ -1,8 +1,21 @@
import { Meteor } from 'meteor/meteor';
import { SysConfig } from '../imports/api/systemConfig';
Meteor.startup(() => {
// code to run on server at startup
Roles.createRole("user", {unlessExists: true});
Roles.createRole("admin", {unlessExists: true});
Roles.createRole("systemadmin", {unlessExists: true});
// set the systemconfig defaults for registration
let regPolicy = SysConfig.findOne({});
if (typeof regPolicy == 'undefined') {
return SysConfig.insert({
SysAdminReg: false,
dateAdded: new Date(),
allowReg: true,
});
} else {
console.log("Registration policy already set.");
}
});