diff options
author | Eric Milkie <milkie@10gen.com> | 2013-12-19 17:12:12 -0500 |
---|---|---|
committer | Eric Milkie <milkie@10gen.com> | 2013-12-24 14:04:22 -0500 |
commit | f148caa11e97727949b5e8594b7439856faff499 (patch) | |
tree | bf19ff059f11538c2a87c4e3e685f70e5a026937 /src/mongo/db/auth/user_set.h | |
parent | ee0365ac659fa89758263d19327d69c547eb2d50 (diff) | |
download | mongo-f148caa11e97727949b5e8594b7439856faff499.tar.gz |
SERVER-11192 hook c++ driver to transmit mongos authenticated users to mongod, for auditing
Also, add UserNameIterator as a parallel to RoleIterator.
Diffstat (limited to 'src/mongo/db/auth/user_set.h')
-rw-r--r-- | src/mongo/db/auth/user_set.h | 33 |
1 files changed, 1 insertions, 32 deletions
diff --git a/src/mongo/db/auth/user_set.h b/src/mongo/db/auth/user_set.h index ad193654e52..591a9bdb9fa 100644 --- a/src/mongo/db/auth/user_set.h +++ b/src/mongo/db/auth/user_set.h @@ -37,37 +37,6 @@ namespace mongo { public: typedef std::vector<User*>::const_iterator iterator; - /** - * Forward iterator over the names of the users stored in a UserSet. - * - * Instances are valid until the underlying vector<User*> is modified. - * - * more() must be the first method called after construction, and must be checked - * after each call to next() before calling any other methods. - */ - class NameIterator { - public: - explicit NameIterator(iterator begin, iterator end) : _curr(begin), _end(end) {} - - NameIterator() {} - - bool more() { return _curr != _end; } - const UserName& next() { - const UserName& ret = get(); - ++_curr; - return ret; - } - - const UserName& get() const { return (*_curr)->getName(); } - - const UserName& operator*() const { return get(); } - const UserName* operator->() const { return &get(); } - - private: - std::vector<User*>::const_iterator _curr; - std::vector<User*>::const_iterator _end; - }; - UserSet(); ~UserSet(); @@ -121,7 +90,7 @@ namespace mongo { // Gets an iterator over the names of the users stored in the set. The iterator is // valid until the next non-const method is called on the UserSet. - NameIterator getNames() const { return NameIterator(begin(), end()); } + UserNameIterator getNames() const; iterator begin() const { return _users.begin(); } iterator end() const { return _usersEnd; } |