[SERVER-1698] A shell function should be implemented to see if the client is authenticated with the db Created: 29/Aug/10 Updated: 19/Mar/13 Resolved: 11/Mar/13 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Internal Client, Shell |
| Affects Version/s: | 1.6.1 |
| Fix Version/s: | None |
| Type: | New Feature | Priority: | Minor - P4 |
| Reporter: | Fabian Becker | Assignee: | Spencer Brody (Inactive) |
| Resolution: | Duplicate | Votes: | 2 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||
| Participants: | |||||||||||||||||
| Description |
|
A shell function should be available and return true if a user is authenticated against a database. I propose to use "isAuthorized" as name. A function with this name exists in security.h and can be re-used for this issue. bool isAuthorized(const string& dbname) { return _isAuthorized( dbname,2 ); } |
| Comments |
| Comment by Spencer Brody (Inactive) [ 11/Mar/13 ] | |
|
This has been solved with the introduction of the connectionStatus command, which lists all authenticated users on all databases. If you just want to check if you are authenticated as some user, you can check
| |
| Comment by Rodrigo Coelho [ 05/Jan/12 ] | |
|
Note: Authentication != Authorization Ref: http://en.wikipedia.org/wiki/Authentication#Authentication_vs._authorization | |
| Comment by Fabian Becker [ 04/Oct/10 ] | |
|
Brian Gianforcaro created a nice patch that implements the above feature. He also created a pull request on Github (http://github.com/mongodb/mongo/pull/5). I tested the patch and it works nicely. |