https://github.com/peerlibrary/meteor-user-extra
Extended Meteor.userId() and Meteor.user()
https://github.com/peerlibrary/meteor-user-extra
meteor meteor-package
Last synced: 25 days ago
JSON representation
Extended Meteor.userId() and Meteor.user()
- Host: GitHub
- URL: https://github.com/peerlibrary/meteor-user-extra
- Owner: peerlibrary
- License: bsd-3-clause
- Created: 2015-12-19T12:06:14.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2019-09-20T04:17:28.000Z (over 5 years ago)
- Last Synced: 2025-04-19T12:42:21.713Z (about 1 month ago)
- Topics: meteor, meteor-package
- Language: CoffeeScript
- Homepage: https://atmospherejs.com/peerlibrary/user-extra
- Size: 9.77 KB
- Stars: 18
- Watchers: 8
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Extended Meteor.userId() and Meteor.user()
==========================================Adding this package to your [Meteor](http://www.meteor.com/) application:
* makes [`Meteor.userId()`](http://docs.meteor.com/#/full/meteor_userid)
work also inside the publish endpoint functions (even for Meteor versions prior to 1.5.1)
* prevents direct modification of the user's profile from the client, which
is otherwise allowed by Meteor
* extends [`Meteor.user(userId)`](http://docs.meteor.com/#/full/meteor_user)
into `Meteor.user(userId, fields)` which now accepts an argument to limit
queried fields (and thus function's reactivity); `userId` is optional and if
not specified `Meteor.userId()` is used insteadBoth client and server side.
Installation
------------```
meteor add peerlibrary:user-extra
```Examples
--------```javascript
Template.user.helpers({
username: function () {
var user = Meteor.user({username: 1});
return user && user.username;
}
});
```