use of org.pentaho.platform.engine.security.acls.voter.PentahoAllowAllAclVoter in project data-access by pentaho.
the class DataSourcePublishIT method setUp.
@Before
public void setUp() throws Exception {
repositoryBase.setUp();
repositoryBase.loginAsRepositoryAdmin();
defaultTenant = repositoryBase.createTenant(repositoryBase.getSystemTenant(), TenantUtils.getDefaultTenant());
singleTenantAdminUserName = (String) applicationContext.getBean("singleTenantAdminUserName");
repositoryBase.createUser(defaultTenant, singleTenantAdminUserName, PASSWORD, new String[] { repositoryBase.getTenantAdminRoleName() });
final String singleTenantAuthenticatedAuthorityName = (String) applicationContext.getBean("singleTenantAuthenticatedAuthorityName");
repositoryBase.createUser(defaultTenant, USERNAME_SUZY, PASSWORD, new String[] { singleTenantAuthenticatedAuthorityName });
repositoryBase.createUser(defaultTenant, USERNAME_TIFFANY, PASSWORD, new String[] { singleTenantAuthenticatedAuthorityName });
repositoryBase.login(singleTenantAdminUserName, defaultTenant, new String[] { repositoryBase.getTenantAdminRoleName() });
final IUnifiedRepository repo = PentahoSystem.get(IUnifiedRepository.class);
String etcID = String.valueOf(repo.getFile(ClientRepositoryPaths.getEtcFolderPath()).getId());
repo.createFolder(etcID, new RepositoryFile.Builder(MondrianCatalogHelper.MONDRIAN_DATASOURCE_FOLDER).folder(true).build(), "initialization");
repo.createFolder(etcID, new RepositoryFile.Builder(PentahoMetadataDomainRepositoryInfo.getMetadataFolderName()).folder(true).build(), "initialization");
final MicroPlatform mp = repositoryBase.getMp();
mp.define(IMondrianCatalogService.class, MondrianCatalogHelper.class);
mp.define(ISystemConfig.class, SystemConfig.class);
mp.defineInstance(IPlatformMimeResolver.class, applicationContext.getBean("IPlatformImportMimeResolver"));
mp.defineInstance(IPlatformImporter.class, applicationContext.getBean("IPlatformImporter"));
mp.defineInstance(ICacheManager.class, applicationContext.getBean("ICacheManager"));
mp.defineInstance(IMetadataDomainRepository.class, applicationContext.getBean("IMetadataDomainRepository"));
final PluginResourceLoader pluginResourceLoader = (PluginResourceLoader) applicationContext.getBean("IPluginResourceLoader");
pluginResourceLoader.setRootDir(new File("target/test-classes/solutionACL/system/data-access"));
mp.defineInstance(IPluginResourceLoader.class, pluginResourceLoader);
mp.define(IDataAccessPermissionHandler.class, SimpleDataAccessPermissionHandler.class);
mp.define(IDataAccessViewPermissionHandler.class, SimpleDataAccessViewPermissionHandler.class);
mp.defineInstance(IAclVoter.class, new PentahoAllowAllAclVoter());
SecurityContextHolder.setStrategyName(SecurityContextHolder.MODE_GLOBAL);
super.setUp();
}
Aggregations