https://github.com/apiko-dev/publish-authorized
Publish only for authorized users or using custom security check
https://github.com/apiko-dev/publish-authorized
Last synced: 4 months ago
JSON representation
Publish only for authorized users or using custom security check
- Host: GitHub
- URL: https://github.com/apiko-dev/publish-authorized
- Owner: apiko-dev
- License: mit
- Created: 2015-10-22T11:38:13.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2016-01-20T14:24:29.000Z (over 9 years ago)
- Last Synced: 2025-01-16T06:12:09.835Z (6 months ago)
- Language: JavaScript
- Homepage: https://atmospherejs.com/jss/publish-authorized
- Size: 10.7 KB
- Stars: 1
- Watchers: 13
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## Publish Authorized
Enables publish data only to authorized users
[](https://atmospherejs.com/jss/publish-authorized)
## Examples
```javascript
//enable access to MyCollection only for authorized users
Meteor.publishAuthorized('mySecuredPublish', function (category) {
return MyCollection.find({category: category});
});//enable access to MyCollection only for specific users using custom check
Meteor.publishAuthorized('mySecuredPublish', function (category) {
return MyCollection.find({category: category});
}, function (userId) {
return customAccessCheckForMyCollection(userId);
});
```## License
Note that this project is distributed under the [MIT License](LICENSE).
Made by [](http://jssolutionsdev.com) - [Professional Meteor Development Company](http://jssolutionsdev.com)