Package org.pentaho.platform.api.engine

Examples of org.pentaho.platform.api.engine.IUserRoleListService


  /**
   * Returns XML for list of users.
   */
  protected Document getUsers() throws ServletException, IOException {
    IUserRoleListService service = PentahoSystem.get( IUserRoleListService.class );
    Element rootElement = new DefaultElement( "users" );
    Document doc = DocumentHelper.createDocument( rootElement );
    if ( service != null ) {
      List users = service.getAllUsers();
      for ( Iterator usersIterator = users.iterator(); usersIterator.hasNext(); ) {
        String username = usersIterator.next().toString();
        if ( ( null != username ) && ( username.length() > 0 ) ) {
          rootElement.addElement( "user" ).addCDATA( username );
        }
View Full Code Here


  /**
   * Returns XML for list of roles.
   */
  protected Document getRoles() throws ServletException, IOException {
    IUserRoleListService service = PentahoSystem.get( IUserRoleListService.class );
    Element rootElement = new DefaultElement( "roles" );
    Document doc = DocumentHelper.createDocument( rootElement );
    if ( service != null ) {
      List roles = service.getAllRoles();
      for ( Iterator rolesIterator = roles.iterator(); rolesIterator.hasNext(); ) {
        String roleName = rolesIterator.next().toString();
        if ( ( null != roleName ) && ( roleName.length() > 0 ) ) {
          rootElement.addElement( "role" ).addCDATA( roleName );
        }
View Full Code Here

    }
    return null;
  }

  protected Object getSystemRoleNames() {
    IUserRoleListService service = PentahoSystem.get( IUserRoleListService.class );
    if ( service != null ) {
      return service.getAllRoles();
    }
    return null;
  }
View Full Code Here

    }
    return null;
  }

  protected Object getSystemUserNames() {
    IUserRoleListService service = PentahoSystem.get( IUserRoleListService.class );
    if ( service != null ) {
      return service.getAllUsers();
    }
    return null;
  }
View Full Code Here

  public Document getUsers() throws ServletException, IOException, IllegalAccessException {
    if ( !canAdminister() ) {
      throw new IllegalAccessException();
    }

    IUserRoleListService service = PentahoSystem.get( IUserRoleListService.class );
    Element rootElement = new DefaultElement( "users" ); //$NON-NLS-1$
    Document doc = DocumentHelper.createDocument( rootElement );
    if ( service != null ) {
      List<String> users = service.getAllUsers();
      for ( Iterator<String> usersIterator = users.iterator(); usersIterator.hasNext(); ) {
        String username = usersIterator.next().toString();
        if ( ( null != username ) && ( username.length() > 0 ) ) {
          rootElement.addElement( "user" ).setText( username ); //$NON-NLS-1$
        }
View Full Code Here

  /**
   * Returns XML for list of roles.
   */
  public Document getRoles() throws ServletException, IOException {
    IUserRoleListService service = PentahoSystem.get( IUserRoleListService.class );
    Element rootElement = new DefaultElement( "roles" ); //$NON-NLS-1$
    Document doc = DocumentHelper.createDocument( rootElement );
    if ( service != null ) {
      List<String> roles = service.getAllRoles();
      for ( Iterator<String> rolesIterator = roles.iterator(); rolesIterator.hasNext(); ) {
        String roleName = rolesIterator.next().toString();
        if ( ( null != roleName ) && ( roleName.length() > 0 ) ) {
          rootElement.addElement( "role" ).setText( roleName ); //$NON-NLS-1$
        }
View Full Code Here

  /**
   * Returns XML for list of Roles for a given User.
   */
  public Document getRolesForUser( String user ) throws ServletException, IOException {
    IUserRoleListService service = PentahoSystem.get( IUserRoleListService.class );
    Element rootElement = new DefaultElement( "roles" ); //$NON-NLS-1$
    Document doc = DocumentHelper.createDocument( rootElement );
    if ( service != null ) {
      List<String> roles = service.getRolesForUser( null, user );
      for ( Iterator<String> rolesIterator = roles.iterator(); rolesIterator.hasNext(); ) {
        String roleName = rolesIterator.next().toString();
        if ( ( null != roleName ) && ( roleName.length() > 0 ) ) {
          rootElement.addElement( "role" ).setText( roleName ); //$NON-NLS-1$
        }
View Full Code Here

  /**
   * Returns XML for list of Users for a given Role.
   */
  public Document getUsersInRole( String role ) throws ServletException, IOException {
    IUserRoleListService service = PentahoSystem.get( IUserRoleListService.class );
    Element rootElement = new DefaultElement( "users" ); //$NON-NLS-1$
    Document doc = DocumentHelper.createDocument( rootElement );
    if ( service != null ) {
      List<String> users = service.getUsersInRole( null, role );
      for ( Iterator<String> usersIterator = users.iterator(); usersIterator.hasNext(); ) {
        String username = usersIterator.next().toString();
        if ( ( null != username ) && ( username.length() > 0 ) ) {
          rootElement.addElement( "user" ).setText( username ); //$NON-NLS-1$
        }
View Full Code Here

      throw new UnauthorizedException();
    }
  }

  public UserListWrapper getUsers() {
    IUserRoleListService service = getUserRoleListService();
    List<String> allUsers = service.getAllUsers();
    if ( null != userComparator ) {
      Collections.sort( allUsers, userComparator );
    }
    return new UserListWrapper( allUsers );
  }
View Full Code Here

    return new RoleListWrapper( systemRoles );
  }

  public RoleListWrapper getPermissionRoles( String adminRole ) {
    IUserRoleListService userRoleListService = getUserRoleListService();
    List<String> allRoles = userRoleListService.getAllRoles();
    // We will not allow user to update permission for Administrator
    if ( allRoles.contains( adminRole ) ) {
      allRoles.remove( adminRole );
    }
View Full Code Here

TOP

Related Classes of org.pentaho.platform.api.engine.IUserRoleListService

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.