mirror of
https://gitlab.com/bmcgonag/get_my.git
synced 2026-03-27 00:08:49 +00:00
Updated Login and User Management with new materialize and controls
This commit is contained in:
parent
81559683eb
commit
1d7ecc3efa
13 changed files with 280 additions and 84 deletions
|
|
@ -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});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
});
|
||||
|
|
@ -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);
|
||||
}
|
||||
})
|
||||
Loading…
Add table
Add a link
Reference in a new issue