Skip to content

Commit ab55025

Browse files
committed
fix: add readWrite role to mongo user roles
1 parent 487f05c commit ab55025

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

adapters/mongo_adapter.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ func (adapter mongoAdapter) CreateDatabaseUser(ctx context.Context, database str
6060
bson.D{
6161
{Key: "createUser", Value: username},
6262
{Key: "pwd", Value: password},
63-
{Key: "roles", Value: []bson.M{{"role": "dbAdmin", "db": database}}}}).Err()
63+
{Key: "roles", Value: []bson.M{{"role": "dbAdmin", "db": database}, {"role": "readWrite", "db": database}}}}).Err()
6464
}
6565

6666
func (adapter mongoAdapter) DeleteDatabaseUser(ctx context.Context, database string, username string) error {

0 commit comments

Comments
 (0)