Updated Login and User Management with new materialize and controls

This commit is contained in:
Brian McGonagill 2024-07-25 09:56:37 -05:00
parent 81559683eb
commit 1d7ecc3efa
13 changed files with 280 additions and 84 deletions

View file

@ -3,8 +3,6 @@ import { Meteor } from 'meteor/meteor';
Meteor.startup(() => {
// code to run on server at startup
Roles.createRole("user", {unlessExists: true});
Roles.createRole("groupLeader", {unlessExists: true});
Roles.createRole("groupMember", {unlessExists: true});
Roles.createRole("admin", {unlessExists: true});
Roles.createRole("systemadmin", {unlessExists: true});
});

View file

@ -32,11 +32,30 @@ Meteor.methods({
}
},
'edit.userPass' (userId, newPassword) {
check(userId, String);
check(newPassword, String);
return Accounts.setPassword(userId, newPassword);
},
'delete.userFromSys' (userId) {
check(userId, String);
return Meteor.users.remove({ _id: userId });
},
'update.userEmail' (userId, email) {
check(userId, String);
check(email, String);
return Meteor.users.update({ _id: userId }, {
$set: {
'emails.0.address': email,
}
});
},
'edit.userRole' (userId, role) {
check(userId, String);
check(role, String);
return Roles.setUserRoles(userId, role);
}
});

View file

@ -110,4 +110,12 @@ Meteor.publish("myTasks", function() {
} catch (error) {
console.log(" ERROR pulling the task items: " + error);
}
});
});
Meteor.publish("rolesAvailable", function() {
try {
return Meteor.roles.find({});
} catch (error) {
console.log(" ERROR publishing roles: " + error);
}
})