mirror of
https://github.com/vale981/Vulcan
synced 2025-03-08 19:11:38 -05:00
19 lines
404 B
JavaScript
19 lines
404 B
JavaScript
/**
|
|
* Telescope Users namespace
|
|
* @namespace Users
|
|
*/
|
|
Users = Meteor.users;
|
|
|
|
Users.getUser = function (userOrUserId) {
|
|
if (typeof userOrUserId === "undefined") {
|
|
if (!Meteor.user()) {
|
|
throw new Error();
|
|
} else {
|
|
return Meteor.user();
|
|
}
|
|
} else if (typeof userOrUserId === "string") {
|
|
return Meteor.users.findOne(userOrUserId);
|
|
} else {
|
|
return userOrUserId;
|
|
}
|
|
};
|