Many changes aded to system.
This commit is contained in:
parent
e0571d14b7
commit
5ba618f471
22 changed files with 640 additions and 57 deletions
|
|
@ -11,9 +11,12 @@ Meteor.methods({
|
|||
if (user) {
|
||||
let userId = user._id;
|
||||
if (countOfUsers > 1) {
|
||||
await Roles.addUsersToRolesAsync(userId, role);
|
||||
let addedRole = await Roles.addUsersToRolesAsync(userId, role);
|
||||
} else if (countOfUsers == 1) {
|
||||
await Roles.addUsersToRolesAsync(userId, "systemadmin");
|
||||
let addedRole = await Roles.addUsersToRolesAsync(userId, "systemadmin");
|
||||
if (addedRole) {
|
||||
await Meteor.callAsync('addUserToTenant', userId, "000001");
|
||||
}
|
||||
} else {
|
||||
console.log("The count of users didn't seem to work when adding a new user.");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,8 @@ import { SysConfig } from "../imports/api/systemConfig";
|
|||
import { UpdateInfo } from "../imports/api/updateInfo";
|
||||
import { MScripts } from "../imports/api/mScripts";
|
||||
import { UserInfo } from "../imports/api/userInfo";
|
||||
import { Locations } from "../imports/api/locations";
|
||||
import { LocationTypes } from "../imports/api/locationTypes";
|
||||
import { Roels } from "meteor/roles";
|
||||
|
||||
Meteor.publish("SystemConfig", function() {
|
||||
|
|
@ -34,3 +36,17 @@ Meteor.publish(null, function () {
|
|||
}
|
||||
this.ready();
|
||||
});
|
||||
|
||||
Meteor.publish("Locations", function () {
|
||||
if (this.userId) {
|
||||
return Locations.find({});
|
||||
}
|
||||
this.ready();
|
||||
});
|
||||
|
||||
Meteor.publish("LocationTypes", function () {
|
||||
if (this.userId) {
|
||||
return LocationTypes.find({});
|
||||
}
|
||||
this.ready();
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue