Search in sources :

Example 1 with PentahoAllowAllAclVoter

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();
}
Also used : PluginResourceLoader(org.pentaho.platform.plugin.services.pluginmgr.PluginResourceLoader) IPluginResourceLoader(org.pentaho.platform.api.engine.IPluginResourceLoader) PentahoAllowAllAclVoter(org.pentaho.platform.engine.security.acls.voter.PentahoAllowAllAclVoter) MicroPlatform(org.pentaho.test.platform.engine.core.MicroPlatform) RepositoryFile(org.pentaho.platform.api.repository2.unified.RepositoryFile) RepositoryFile(org.pentaho.platform.api.repository2.unified.RepositoryFile) File(java.io.File) IUnifiedRepository(org.pentaho.platform.api.repository2.unified.IUnifiedRepository) Before(org.junit.Before)

Aggregations

File (java.io.File)1 Before (org.junit.Before)1 IPluginResourceLoader (org.pentaho.platform.api.engine.IPluginResourceLoader)1 IUnifiedRepository (org.pentaho.platform.api.repository2.unified.IUnifiedRepository)1 RepositoryFile (org.pentaho.platform.api.repository2.unified.RepositoryFile)1 PentahoAllowAllAclVoter (org.pentaho.platform.engine.security.acls.voter.PentahoAllowAllAclVoter)1 PluginResourceLoader (org.pentaho.platform.plugin.services.pluginmgr.PluginResourceLoader)1 MicroPlatform (org.pentaho.test.platform.engine.core.MicroPlatform)1