Package org.pentaho.platform.api.engine.security.userroledao

Examples of org.pentaho.platform.api.engine.security.userroledao.IPentahoRole


    user.setPassword( password );
  }

  public void setRoleDescription( ITenant tenant, String roleName, String description ) throws NotFoundException,
    UncategorizedUserRoleDaoException {
    IPentahoRole role = getRole( tenant, roleName );
    if ( role == null ) {
      throw new NotFoundException( roleName );
    }
    role.setDescription( description );
  }
View Full Code Here


    }
    if ( tenant == null || tenant.getId() == null ) {
      tenant = getCurrentTenant();
    }

    IPentahoRole role = getRole( tenant, roleName );
    HashSet<IPentahoUser> users = roleMembers.get( role );
    users.clear();
    if ( userNames != null ) {
      for ( String userName : userNames ) {
        IPentahoUser user = getUser( tenant, userName );
View Full Code Here

    if ( roleNames != null ) {
      roleSet.addAll( Arrays.asList( roleNames ) );
    }
    roleSet.add( authenticatedRoleName );

    IPentahoRole authRole = getRole( tenant, authenticatedRoleName );

    IPentahoUser user = getUser( tenant, userName );
    roleMembers.get( authRole ).add( user );

    HashSet<IPentahoRole> roles = userRoles.get( user );
    roles.clear();
    for ( String roleName : roleSet ) {
      IPentahoRole role = getRole( tenant, roleName );
      if ( role != null ) {
        roles.add( role );
      }
      roleMembers.get( role ).add( user );
    }
View Full Code Here

    if ( logger.isDebugEnabled() ) {
      logger.debug( "Configuring default role mappings." );
    }

    for ( final String roleName : roleMappings.keySet() ) {
      final IPentahoRole role = userRoleDao.getRole( DEFAULT_TENANT, roleName );
      if ( role == null ) {
        if ( logger.isDebugEnabled() ) {
          logger.debug( "Creating user role: " + roleName );
        }
        userRoleDao.createRole( DEFAULT_TENANT, roleName, "", EMPTY_STRING_ARRAY );
View Full Code Here

  /**
   * Synchronizes <code>role</code> with fields from <code>proxyRole</code>. The users set of given
   * <code>role</code> is unmodified.
   */
  public static IPentahoRole syncRoles( IPentahoRole role, ProxyPentahoRole proxyRole ) {
    IPentahoRole syncedRole = role;
    if ( syncedRole == null ) {
      syncedRole = new PentahoRole( proxyRole.getName() );
    }
    syncedRole.setDescription( proxyRole.getDescription() );
    return syncedRole;
  }
View Full Code Here

        tenantManager.createTenant( systemTenant, MAIN_TENANT_1, tenantAdminRoleName,
            tenantAuthenticatedRoleName, ANONYMOUS_ROLE_NAME );
    userRoleDao.createUser( mainTenant_1, USERNAME_ADMIN, PASSWORD, "", new String[] { tenantAdminRoleName } );
    login( USERNAME_ADMIN, mainTenant_1, new String[] { tenantAdminRoleName, tenantAuthenticatedRoleName } );
    IPentahoUser pentahoUser = userRoleDao.createUser( mainTenant_1, USER_2, PASSWORD_2, USER_DESCRIPTION_2, null );
    IPentahoRole pentahoRole = userRoleDao.createRole( mainTenant_1, ROLE_1, ROLE_DESCRIPTION_1, null );
    pentahoRole = userRoleDao.createRole( mainTenant_1, ROLE_2, ROLE_DESCRIPTION_2, null );
    pentahoRole = userRoleDao.createRole( mainTenant_1, ROLE_3, ROLE_DESCRIPTION_3, null );
    userRoleDao.setUserRoles( mainTenant_1, USER_2, new String[] { ROLE_1, ROLE_2, ROLE_3 } );

    UserRoleDaoUserDetailsService userDetailsService = new UserRoleDaoUserDetailsService();
View Full Code Here

TOP

Related Classes of org.pentaho.platform.api.engine.security.userroledao.IPentahoRole

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.