Revert "Defer initialization of default RoleManager until IAuthenticator is set"

This reverts commit 0d2f4038fc.
This commit is contained in:
Jonathan Ellis 2015-09-02 09:35:45 -05:00
parent 45dd5d178f
commit f7644f265a
1 changed files with 3 additions and 6 deletions

View File

@ -87,9 +87,7 @@ public class DatabaseDescriptor
private static IAuthenticator authenticator = new AllowAllAuthenticator();
private static IAuthorizer authorizer = new AllowAllAuthorizer();
// Don't initialize the role manager until applying config. The options supported by CassandraRoleManager
// depend on the configured IAuthenticator, so defer creating it until that's been set.
private static IRoleManager roleManager;
private static IRoleManager roleManager = new CassandraRoleManager();
private static IRequestScheduler requestScheduler;
private static RequestSchedulerId requestSchedulerId;
@ -325,9 +323,8 @@ public class DatabaseDescriptor
if (authenticator instanceof AllowAllAuthenticator && !(authorizer instanceof AllowAllAuthorizer))
throw new ConfigurationException("AllowAllAuthenticator can't be used with " + conf.authorizer, false);
roleManager = conf.role_manager == null
? new CassandraRoleManager()
: FBUtilities.newRoleManager(conf.role_manager);
if (conf.role_manager != null)
roleManager = FBUtilities.newRoleManager(conf.role_manager);
if (authenticator instanceof PasswordAuthenticator && !(roleManager instanceof CassandraRoleManager))
throw new ConfigurationException("CassandraRoleManager must be used with PasswordAuthenticator", false);