Many changes aded to system.

This commit is contained in:
Brian McGonagill 2026-01-24 13:49:38 -06:00
parent e0571d14b7
commit 5ba618f471
22 changed files with 640 additions and 57 deletions

View file

@ -6,11 +6,23 @@ export const UserInfo = new Mongo.Collection('userInfo');
UserInfo.allow({
insert: function(userId, doc){
// if use id exists, allow insert
// if user id exists, allow insert
return !!userId;
},
});
Meteor.methods({
async 'addUserToTenant' (userId, tenant_id) {
check(userId, String);
check(tenant_id, String);
if (!this.userId) {
throw new Meteor.Error('You are not allowed to add tenants for users. Make sure you are logged in with valid user credentials.');
}
return await UserInfo.insertAsync({
userId: userId,
tenant_id: tenant_id,
});
},
});