Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import com.arcadedb.database.DatabaseInternal;
import com.arcadedb.log.LogManager;
import com.arcadedb.security.SecurityManager;
import com.arcadedb.serializer.json.JSONArray;
import com.arcadedb.serializer.json.JSONException;
import com.arcadedb.serializer.json.JSONObject;
import com.arcadedb.server.ArcadeDBServer;
Expand Down Expand Up @@ -125,7 +126,7 @@ public void loadUsers() {
}
}

if (users.isEmpty() || (users.containsKey("root") && users.get("root").getPassword() == null))
if (users.isEmpty() || !users.containsKey("root") || (users.containsKey("root") && users.get("root").getPassword() == null))
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean we could even remove users.isEmpty()

askForRootPassword();

final long fileLastModified = usersRepository.getFileLastModified();
Expand Down Expand Up @@ -447,7 +448,9 @@ protected void askForRootPassword() throws IOException {
getUser("root").setPassword(encodedPassword);
saveUsers();
} else
createUser(new JSONObject().put("name", "root").put("password", encodedPassword));
createUser(new JSONObject().put("name", "root")
.put("password", encodedPassword)
.put("databases", new JSONObject().put(SecurityManager.ANY, new JSONArray(new String[] { "admin" }))));
}

protected JSONObject getDatabaseGroupsConfiguration(final String databaseName) {
Expand Down
Loading