use of org.pentaho.platform.api.mt.ITenantedPrincipleNameResolver in project pentaho-platform by pentaho.
the class MockUserRoleDao method getPrincipalName.
protected String getPrincipalName(String principalId, boolean isUser) {
String principalName = null;
ITenantedPrincipleNameResolver nameUtils = isUser ? userNameResolver : roleNameResolver;
if (nameUtils != null) {
principalName = nameUtils.getPrincipleName(principalId);
}
return principalName;
}
use of org.pentaho.platform.api.mt.ITenantedPrincipleNameResolver in project pentaho-platform by pentaho.
the class DefaultUnifiedRepositoryBase method getPrincipalName.
protected String getPrincipalName(String principalId, boolean isUser) {
String principalName = null;
ITenantedPrincipleNameResolver nameUtils = isUser ? userNameUtils : roleNameUtils;
if (nameUtils != null) {
principalName = nameUtils.getPrincipleName(principalId);
}
return principalName;
}
use of org.pentaho.platform.api.mt.ITenantedPrincipleNameResolver in project pentaho-kettle by pentaho.
the class PurRepositoryIT method getTenant.
protected ITenant getTenant(String principalId, boolean isUser) {
ITenant tenant = null;
ITenantedPrincipleNameResolver nameUtils = isUser ? userNameUtils : roleNameUtils;
if (nameUtils != null) {
tenant = nameUtils.getTenant(principalId);
}
if (tenant == null || tenant.getId() == null) {
tenant = getCurrentTenant();
}
return tenant;
}
use of org.pentaho.platform.api.mt.ITenantedPrincipleNameResolver in project pentaho-kettle by pentaho.
the class UIEERepositoryDirectoryIT method getPrincipalName.
private String getPrincipalName(String principalId, boolean isUser) {
String principalName = null;
ITenantedPrincipleNameResolver nameUtils = isUser ? userNameUtils : roleNameUtils;
if (nameUtils != null) {
principalName = nameUtils.getPrincipleName(principalId);
}
return principalName;
}
use of org.pentaho.platform.api.mt.ITenantedPrincipleNameResolver in project pentaho-platform by pentaho.
the class AbstractJcrBackedUserRoleDaoTest method testConvertToPentahoUserDisableCache.
@Test
public void testConvertToPentahoUserDisableCache() throws RepositoryException {
AbstractJcrBackedUserRoleDao abstractJcrBackedUserRoleDaoMock = mock(AbstractJcrBackedUserRoleDao.class);
doCallRealMethod().when(abstractJcrBackedUserRoleDaoMock).convertToPentahoUser(nullable(User.class));
ITenantedPrincipleNameResolver resolverMock = mock(ITenantedPrincipleNameResolver.class);
when(abstractJcrBackedUserRoleDaoMock.getTenantedUserNameUtils()).thenReturn(resolverMock);
// Cache mocking
LRUMap cacheMock = mock(LRUMap.class);
when(abstractJcrBackedUserRoleDaoMock.getUserCache()).thenReturn(cacheMock);
User userMock = mock(User.class);
abstractJcrBackedUserRoleDaoMock.convertToPentahoUser(userMock);
verify(cacheMock, never()).put(any(), anyString());
}
Aggregations