New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove admin database access requirement (hopefully solved by #61) #60

Closed
wants to merge 1 commit into
base: master
from

Conversation

Projects
None yet
3 participants
@aolieman
Copy link

aolieman commented Dec 13, 2014

Hi @JamesCropcho, @smgardner59,

I needed to do a bit more to get variety working with a user that only had access to the target db:

mongo -u USER -p PASS TARGET_DB --eval "var collection = 'COLLECTION'" variety.js

This fixes #40 at the expense of error reporting when the specified database is empty or does not exist.
Lines 29-46 needed to be removed because they rely on an admin function. This also deprecates lines 21 and 22. Code review requested, because I just did this as a quick fix.

Remove admin database access requirement
Hi @JamesCropcho, @smgardner59,

I needed to do a bit more to get variety working with a user that only had access to the target db:
```
mongo -u USER -p PASS TARGET_DB --eval "var collection = 'COLLECTION'" variety.js
```

This fixes #40 at the expense of error reporting when the specified database is empty or does not exist.
Lines 29-46 needed to be removed because they rely on an admin function. This also deprecates lines  21 and 22. Code review requested, because I just did this as a quick fix.
@JamesCropcho

This comment has been minimized.

Copy link
Member

JamesCropcho commented Dec 15, 2014

Hello Alex,

Thank you very much for this. We have been thinking for some time about how to make Variety work for those without admin access.

And while that is important to us, I do also quite like the error messages we have, since they keep the learning curve shallow.

In a perfect world, we would provide the helpful messages when we have admin access, yet not fail when we don't.

Wes (@wfreeman), Tomáš (@todvora), what do you two think?

Thanks Once More,
-James

@todvora

This comment has been minimized.

Copy link
Contributor

todvora commented Dec 18, 2014

Hi @aolieman and @JamesCropcho,
I tried to make Variety working without admin access AND preserve error messages with empty and nonexistent databases and collections. See #61.

It should work with 2.4.x and 2.6.x branches of MongoDB.

@aolieman: could you please test Variety from pull request https://github.com/todvora/variety/blob/6a366b35bc84d75c866ad49994f56a85b86b7981/variety.js ? Does it work also with your permissions configuration? There should be persistResults=false used for Variety with limited user.

Thank you,
Tomas

Update: persistResults should be set to false, not true.

@JamesCropcho

This comment has been minimized.

Copy link
Member

JamesCropcho commented Dec 20, 2014

Alex,

I'm going ahead and merging #61 since it's a "best of both worlds" solution. As Tomáš said, if you have a free moment let us know if the newest version of Variety resolves your issue without modification (or even more importantly, if it fails to).

Best,
James

@JamesCropcho JamesCropcho changed the title Remove admin database access requirement Remove admin database access requirement (hopefully solved by #61) Dec 20, 2014

@JamesCropcho

This comment has been minimized.

Copy link
Member

JamesCropcho commented Jan 31, 2015

Alright, closing this for now. Feel free to re-open if there is a development.

@aolieman

This comment has been minimized.

Copy link

aolieman commented Feb 9, 2015

Hi,

Sorry for leaving you hanging there. Testing was inconvenient for me, but the code looks good. I also assume this solves the issue.

Thanks,
Alex

@JamesCropcho

This comment has been minimized.

Copy link
Member

JamesCropcho commented Feb 9, 2015

Cool. Thanks for getting back to us, Alex. Be in touch further for any reason you see fit. -James

@aolieman aolieman deleted the aolieman:patch-1 branch Apr 20, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment