houston
houston copied to clipboard
Expose Users collection to Admin
There are a bunch of weird edge cases when exposing that collection, and it's also a good field test for limiting the fields we expose by default (password hash is not useful to expose, for example).
How do you expose the users collection? I can see it from the mongo shell if I type "meteor mongo" and then "show collections" but if I add:
Houston.add_collection(users);
to the main javascript file in my app, I get a crash as follows:
(STDERR) ReferenceError: users is not defined
This does the trick:
Houston.add_collection(Meteor.users);
If you need to add admins with Houston, you can also do : Houston.add_collection(Houston._admins);
This should go in docs :+1:
If you want to access your users in Houston and/or be able to add houston admins just :
Houston.add_collection(Meteor.users);
Houston.add_collection(Houston._admins);
I vote for showing both users and _admins by default. Especially the second – when I first used the pkg, I was sad that I couldn't find any way under the /admin
UI to add other admins.
+1 For @lorensr's comment-
I vote for showing both users and _admins by default. Especially the second – when I first used the pkg, I was sad that I couldn't find any way under the /admin UI to add other admins.