use of org.apache.cassandra.auth.JMXResource in project cassandra by apache.
the class InvalidateJmxPermissionsCacheTest method setup.
@BeforeClass
public static void setup() throws Exception {
CQLTester.setUpClass();
CQLTester.requireAuthentication();
IRoleManager roleManager = DatabaseDescriptor.getRoleManager();
roleManager.createRole(AuthenticatedUser.SYSTEM_USER, ROLE_A, AuthTestUtils.getLoginRoleOptions());
roleManager.createRole(AuthenticatedUser.SYSTEM_USER, ROLE_B, AuthTestUtils.getLoginRoleOptions());
JMXResource rootJmxResource = JMXResource.root();
Set<Permission> jmxPermissions = rootJmxResource.applicablePermissions();
IAuthorizer authorizer = DatabaseDescriptor.getAuthorizer();
authorizer.grant(AuthenticatedUser.SYSTEM_USER, jmxPermissions, rootJmxResource, ROLE_A);
authorizer.grant(AuthenticatedUser.SYSTEM_USER, jmxPermissions, rootJmxResource, ROLE_B);
AuthCacheService.initializeAndRegisterCaches();
startJMXServer();
}
Aggregations