@Test public void convertFromProxyPentahoUsers_CopiesEachUser() throws Exception { UserRoleSecurityInfo info = new UserRoleSecurityInfo(); info.setUsers( Arrays.asList( pentahoUser( "user1" ), pentahoUser( "user2" ) ) ); IRoleSupportSecurityManager manager = mockSecurityManager( false ); List<IUser> users = convertFromProxyPentahoUsers( info, manager ); assertNotNull( users ); assertEquals( 2, users.size() ); assertEquals( "user1", users.get( 0 ).getName() ); assertEquals( "user2", users.get( 1 ).getName() ); }
public static List<IUser> convertFromProxyPentahoUsers( UserRoleSecurityInfo info, IRoleSupportSecurityManager rsm ) { List<ProxyPentahoUser> users = info.getUsers(); if ( users == null || users.isEmpty() ) { return Collections.emptyList(); } List<UserToRoleAssignment> assignments = info.getAssignments(); List<IUser> userList = new ArrayList<IUser>( users.size() ); for ( ProxyPentahoUser user : users ) { userList.add( convertFromProxyPentahoUser( user, assignments, rsm ) ); } return userList; }
UserRoleHelper implements java.io.Serializable { public static List<IUser> convertFromProxyPentahoUsers( UserRoleSecurityInfo info, IRoleSupportSecurityManager rsm ) { List<ProxyPentahoUser> users = info.getUsers(); if ( users == null || users.isEmpty() ) { return Collections.emptyList(); } List<UserToRoleAssignment> assignments = info.getAssignments(); List<IUser> userList = new ArrayList<IUser>( users.size() ); for ( ProxyPentahoUser user : users ) { userList.add( convertFromProxyPentahoUser( user, assignments, rsm ) ); } return userList; } }
UserRoleHelper implements java.io.Serializable { public static List<IUser> convertFromProxyPentahoUsers( UserRoleSecurityInfo info, IRoleSupportSecurityManager rsm ) { List<ProxyPentahoUser> users = info.getUsers(); if ( users == null || users.isEmpty() ) { return Collections.emptyList(); } List<UserToRoleAssignment> assignments = info.getAssignments(); List<IUser> userList = new ArrayList<IUser>( users.size() ); for ( ProxyPentahoUser user : users ) { userList.add( convertFromProxyPentahoUser( user, assignments, rsm ) ); } return userList; }  }
UserRoleHelper implements java.io.Serializable { public static List<IUser> convertFromProxyPentahoUsers( UserRoleSecurityInfo info, IRoleSupportSecurityManager rsm ) { List<ProxyPentahoUser> users = info.getUsers(); if ( users == null || users.isEmpty() ) { return Collections.emptyList(); } List<UserToRoleAssignment> assignments = info.getAssignments(); List<IUser> userList = new ArrayList<IUser>( users.size() ); for ( ProxyPentahoUser user : users ) { userList.add( convertFromProxyPentahoUser( user, assignments, rsm ) ); } return userList; }  static List<IUser> convertFromProxyPentahoUsers( UserRoleSecurityInfo info, IRoleSupportSecurityManager rsm ); static List<IUser> convertFromNonPentahoUsers( UserRoleInfo info, IRoleSupportSecurityManager rsm ); static List<IRole> convertToListFromProxyPentahoRoles( UserRoleSecurityInfo info,
      IRoleSupportSecurityManager rsm ); static List<IRole> convertToListFromNonPentahoRoles( UserRoleInfo info, IRoleSupportSecurityManager rsm ); static List<IRole> convertToListFromProxyPentahoDefaultRoles( UserRoleSecurityInfo info,
      IRoleSupportSecurityManager rsm ); static ProxyPentahoRole getProxyPentahoRole( IUserRoleWebService userRoleWebService, String name ); static List<IUser> convertToListFromProxyPentahoUsers( ProxyPentahoUser[] users,
      IUserRoleWebService userRoleWebService, UserRoleLookupCache lookupCache, IRoleSupportSecurityManager rsm ); static List<IRole> convertToListFromProxyPentahoRoles( ProxyPentahoRole[] roles,
      IUserRoleWebService userRoleWebService, UserRoleLookupCache lookupCache, IRoleSupportSecurityManager rsm ); static ProxyPentahoUser[] convertToPentahoProxyUsers( Set<IUser> users ); static ProxyPentahoUser[] convertToPentahoProxyUsers( List<IUser> users ); static ProxyPentahoUser convertToPentahoProxyUser( IUser userInfo ); static ProxyPentahoRole[] convertToPentahoProxyRoles( Set<IRole> roles ); static ProxyPentahoRole[] convertToPentahoProxyRoles( List<IRole> roles ); static ProxyPentahoRole convertToPentahoProxyRole( IRole roleInfo ); static IRole convertFromProxyPentahoRole( IUserRoleWebService userRoleWebService, ProxyPentahoRole role,
      UserRoleLookupCache lookupCache, IRoleSupportSecurityManager rsm ); static IUser convertFromProxyPentahoUser( IUserRoleWebService userRoleWebService, ProxyPentahoUser user,
      UserRoleLookupCache lookupCache, IRoleSupportSecurityManager rsm ); static IUser convertToUserInfo( ProxyPentahoUser user, ProxyPentahoRole[] roles,
      IRoleSupportSecurityManager rsm ); static IRole convertFromProxyPentahoRole( ProxyPentahoRole role, List<UserToRoleAssignment> assignments,
      IRoleSupportSecurityManager rsm ); static IRole convertFromNonPentahoRole( String role, IRoleSupportSecurityManager rsm ); static IUser convertFromProxyPentahoUser( ProxyPentahoUser user, List<UserToRoleAssignment> assignments,
      IRoleSupportSecurityManager rsm ); static IUser convertFromNonPentahoUser( String user, IRoleSupportSecurityManager rsm ); static Set<IUser> getUsersForRole( String name, List<UserToRoleAssignment> assignments,
      IRoleSupportSecurityManager rsm ); static Set<IRole> getRolesForUser( String name, List<UserToRoleAssignment> assignments,
      IRoleSupportSecurityManager rsm ); }
UserRoleHelper implements java.io.Serializable { public static List<IUser> convertFromProxyPentahoUsers( UserRoleSecurityInfo info, IRoleSupportSecurityManager rsm ) { List<ProxyPentahoUser> users = info.getUsers(); if ( users == null || users.isEmpty() ) { return Collections.emptyList(); } List<UserToRoleAssignment> assignments = info.getAssignments(); List<IUser> userList = new ArrayList<IUser>( users.size() ); for ( ProxyPentahoUser user : users ) { userList.add( convertFromProxyPentahoUser( user, assignments, rsm ) ); } return userList; }  static List<IUser> convertFromProxyPentahoUsers( UserRoleSecurityInfo info, IRoleSupportSecurityManager rsm ); static List<IUser> convertFromNonPentahoUsers( UserRoleInfo info, IRoleSupportSecurityManager rsm ); static List<IRole> convertToListFromProxyPentahoRoles( UserRoleSecurityInfo info,
      IRoleSupportSecurityManager rsm ); static List<IRole> convertToListFromNonPentahoRoles( UserRoleInfo info, IRoleSupportSecurityManager rsm ); static List<IRole> convertToListFromProxyPentahoDefaultRoles( UserRoleSecurityInfo info,
      IRoleSupportSecurityManager rsm ); static ProxyPentahoRole getProxyPentahoRole( IUserRoleWebService userRoleWebService, String name ); static List<IUser> convertToListFromProxyPentahoUsers( ProxyPentahoUser[] users,
      IUserRoleWebService userRoleWebService, UserRoleLookupCache lookupCache, IRoleSupportSecurityManager rsm ); static List<IRole> convertToListFromProxyPentahoRoles( ProxyPentahoRole[] roles,
      IUserRoleWebService userRoleWebService, UserRoleLookupCache lookupCache, IRoleSupportSecurityManager rsm ); static ProxyPentahoUser[] convertToPentahoProxyUsers( Set<IUser> users ); static ProxyPentahoUser[] convertToPentahoProxyUsers( List<IUser> users ); static ProxyPentahoUser convertToPentahoProxyUser( IUser userInfo ); static ProxyPentahoRole[] convertToPentahoProxyRoles( Set<IRole> roles ); static ProxyPentahoRole[] convertToPentahoProxyRoles( List<IRole> roles ); static ProxyPentahoRole convertToPentahoProxyRole( IRole roleInfo ); static IRole convertFromProxyPentahoRole( IUserRoleWebService userRoleWebService, ProxyPentahoRole role,
      UserRoleLookupCache lookupCache, IRoleSupportSecurityManager rsm ); static IUser convertFromProxyPentahoUser( IUserRoleWebService userRoleWebService, ProxyPentahoUser user,
      UserRoleLookupCache lookupCache, IRoleSupportSecurityManager rsm ); static IUser convertToUserInfo( ProxyPentahoUser user, ProxyPentahoRole[] roles,
      IRoleSupportSecurityManager rsm ); static IRole convertFromProxyPentahoRole( ProxyPentahoRole role, List<UserToRoleAssignment> assignments,
      IRoleSupportSecurityManager rsm ); static IRole convertFromNonPentahoRole( String role, IRoleSupportSecurityManager rsm ); static IUser convertFromProxyPentahoUser( ProxyPentahoUser user, List<UserToRoleAssignment> assignments,
      IRoleSupportSecurityManager rsm ); static IUser convertFromNonPentahoUser( String user, IRoleSupportSecurityManager rsm ); static Set<IUser> getUsersForRole( String name, List<UserToRoleAssignment> assignments,
      IRoleSupportSecurityManager rsm ); static Set<IRole> getRolesForUser( String name, List<UserToRoleAssignment> assignments,
      IRoleSupportSecurityManager rsm );  }