houston icon indicating copy to clipboard operation
houston copied to clipboard

Expose Users collection to Admin

Open AlexeyMK opened this issue 11 years ago • 6 comments

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).

AlexeyMK avatar Dec 05 '13 01:12 AlexeyMK

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

jononomo avatar Dec 13 '13 20:12 jononomo

This does the trick:

Houston.add_collection(Meteor.users);

jononomo avatar Dec 13 '13 22:12 jononomo

If you need to add admins with Houston, you can also do : Houston.add_collection(Houston._admins);

lc3t35 avatar Mar 01 '14 21:03 lc3t35

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);

kevohagan avatar Jun 17 '14 12:06 kevohagan

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.

lorensr avatar Jan 18 '15 23:01 lorensr

+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.

deanrad avatar Feb 08 '15 17:02 deanrad