final GlobalConfigurationBuilder global = new GlobalConfigurationBuilder();
GlobalAuthorizationConfigurationBuilder globalRoles = global.security().authorization().enable()
.principalRoleMapper(new IdentityRoleMapper());
final ConfigurationBuilder config = TestCacheManagerFactory.getDefaultCacheConfiguration(true);
config.transaction().lockingMode(LockingMode.PESSIMISTIC);
config.invocationBatching().enable();
AuthorizationConfigurationBuilder authConfig = config.security().authorization().enable();
for (AuthorizationPermission perm : AuthorizationPermission.values()) {
globalRoles.role(perm.toString()).permission(perm);
authConfig.role(perm.toString());