Skip to content

Commit b60d027

Browse files
committed
JAVA-1039: Deprecated DB.addUser and DB.removeUser
1 parent b6401d5 commit b60d027

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

src/main/com/mongodb/DB.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -726,7 +726,10 @@ public CommandResultPair(final CommandFailureException failure) {
726726
* @param username
727727
* @param passwd
728728
* @throws MongoException
729+
* @deprecated Use {@code DB.command} to call either the addUser or updateUser command
730+
* @mongodb.driver.manual reference/command/nav-user-role/ User manipulation commands
729731
*/
732+
@Deprecated
730733
public WriteResult addUser( String username , char[] passwd ){
731734
return addUser(username, passwd, false);
732735
}
@@ -739,7 +742,10 @@ public WriteResult addUser( String username , char[] passwd ){
739742
* @param passwd
740743
* @param readOnly if true, user will only be able to read
741744
* @throws MongoException
745+
* @deprecated Use {@code DB.command} to call either the addUser or updateUser command
746+
* @mongodb.driver.manual reference/command/nav-user-role/ User manipulation commands
742747
*/
748+
@Deprecated
743749
public WriteResult addUser( String username , char[] passwd, boolean readOnly ){
744750
DBCollection c = getCollection( "system.users" );
745751
DBObject o = c.findOne( new BasicDBObject( "user" , username ) );
@@ -755,7 +761,10 @@ public WriteResult addUser( String username , char[] passwd, boolean readOnly ){
755761
*
756762
* @param username user to be removed
757763
* @throws MongoException
764+
* @deprecated Use {@code DB.command} to call the dropUser command
765+
* @mongodb.driver.manual reference/command/nav-user-role/ User manipulation commands
758766
*/
767+
@Deprecated
759768
public WriteResult removeUser( String username ){
760769
DBCollection c = getCollection( "system.users" );
761770
return c.remove(new BasicDBObject( "user" , username ));

0 commit comments

Comments
 (0)