Examples of mapConnectionRoles()


Examples of org.pentaho.platform.api.engine.IConnectionUserRoleMapper.mapConnectionRoles()

    final IConnectionUserRoleMapper mapper = new MondrianOneToOneUserRoleListMapper();
    try {
      String[] roles = SecurityHelper.getInstance().runAsUser( "simplebob", new Callable<String[]>() {
        @Override
        public String[] call() throws Exception {
          return mapper.mapConnectionRoles( PentahoSessionHolder.getSession(), "SteelWheelsRoles" );
        }
      } );

      Assert.assertNotNull( roles );
      Assert.assertEquals( 2, roles.length );
View Full Code Here

Examples of org.pentaho.platform.api.engine.IConnectionUserRoleMapper.mapConnectionRoles()

      if ( session != null
        && mapper != null ) {
        // Use the role mapper.
        try {
          effectiveRoles =
              mapper
              .mapConnectionRoles(
                  session,
                  catalogName );
          if ( effectiveRoles == null ) {
            effectiveRoles = new String[0];
View Full Code Here

Examples of org.pentaho.platform.api.engine.IConnectionUserRoleMapper.mapConnectionRoles()

        if ( mondrianUserRoleMapper != null
            && catalogName != null ) {
          // Use the role mapper.
          try {
            effectiveRoles =
                mondrianUserRoleMapper
                    .mapConnectionRoles(
                        session,
                        catalogName );
            if ( effectiveRoles == null ) {
              effectiveRoles = new String[0];
View Full Code Here

Examples of org.pentaho.platform.api.engine.IConnectionUserRoleMapper.mapConnectionRoles()

    if (PentahoSystem.getObjectFactory().objectDefined(MDXConnection.MDX_CONNECTION_MAPPER_KEY)) {
      IConnectionUserRoleMapper mondrianUserRoleMapper = PentahoSystem.get(IConnectionUserRoleMapper.class, MDXConnection.MDX_CONNECTION_MAPPER_KEY, null);
      if (mondrianUserRoleMapper != null) {
        OlapConnection c = (OlapConnection) con.getConnection();
        String[] validMondrianRolesForUser = mondrianUserRoleMapper.mapConnectionRoles(PentahoSessionHolder.getSession(), c.getCatalog());
        if (setRole(con, validMondrianRolesForUser, datasource)) {
          return con;
        }
      }
    }
View Full Code Here

Examples of org.pentaho.platform.api.engine.IConnectionUserRoleMapper.mapConnectionRoles()

    if (PentahoSystem.getObjectFactory().objectDefined(MDXConnection.MDX_CONNECTION_MAPPER_KEY)) {
      IConnectionUserRoleMapper mondrianUserRoleMapper = PentahoSystem.get(IConnectionUserRoleMapper.class, MDXConnection.MDX_CONNECTION_MAPPER_KEY, null);
      if (mondrianUserRoleMapper != null) {
        OlapConnection c = (OlapConnection) con.getConnection();
        String[] validMondrianRolesForUser = mondrianUserRoleMapper.mapConnectionRoles(PentahoSessionHolder.getSession(), c.getCatalog());
        if (setRole(con, validMondrianRolesForUser, datasource)) {
          return con;
        }
      }
    }
View Full Code Here

Examples of org.pentaho.platform.api.engine.IConnectionUserRoleMapper.mapConnectionRoles()

        IConnectionUserRoleMapper mondrianUserRoleMapper =
          PentahoSystem.get( IConnectionUserRoleMapper.class, MDXConnection.MDX_CONNECTION_MAPPER_KEY, null );
        if ( mondrianUserRoleMapper != null ) {
          // Do role mapping
          String[] validMondrianRolesForUser =
            mondrianUserRoleMapper.mapConnectionRoles( PentahoSessionHolder.getSession(), properties
              .get( RolapConnectionProperties.Catalog.name() ) );
          if ( ( validMondrianRolesForUser != null ) && ( validMondrianRolesForUser.length > 0 ) ) {
            StringBuffer buff = new StringBuffer();
            String aRole = null;
            for ( int i = 0; i < validMondrianRolesForUser.length; i++ ) {
View Full Code Here

Examples of org.pentaho.platform.plugin.action.mondrian.mapper.MondrianLookupMapUserRoleListMapper.mapConnectionRoles()

    try {
      String[] roles = SecurityHelper.getInstance().runAsUser( "admin", new Callable<String[]>() {
        @Override
        public String[] call() throws Exception {
          return mapper.mapConnectionRoles( PentahoSessionHolder.getSession(), "SteelWheelsRoles" );
        }
      } );
      Assert.assertNotNull( roles );
      Assert.assertEquals( 1, roles.length );
      Assert.assertEquals( "Role1", roles[0] );
View Full Code Here

Examples of org.pentaho.platform.plugin.action.mondrian.mapper.MondrianLookupMapUserRoleListMapper.mapConnectionRoles()

    mapper.setFailOnEmptyRoleList( true );
    try {
      SecurityHelper.getInstance().runAsUser( "admin", new Callable<String[]>() {
        @Override
        public String[] call() throws Exception {
          return mapper.mapConnectionRoles( PentahoSessionHolder.getSession(), "SteelWheelsRoles" );
        }
      } );
      Assert.fail();
    } catch ( PentahoAccessControlException e ) {
      // no op.
View Full Code Here

Examples of org.pentaho.platform.plugin.action.mondrian.mapper.MondrianLookupMapUserRoleListMapper.mapConnectionRoles()

    try {
      String[] roles = SecurityHelper.getInstance().runAsUser( "admin", new Callable<String[]>() {
        @Override
        public String[] call() throws Exception {
          return mapper.mapConnectionRoles( PentahoSessionHolder.getSession(), "SteelWheelsRoles" );
        }
      } );
      Assert.assertNull( roles );
    } catch ( PentahoAccessControlException e ) {
      Assert.fail( e.getMessage() );
View Full Code Here

Examples of org.pentaho.platform.plugin.action.mondrian.mapper.MondrianOneToOneUserRoleListMapper.mapConnectionRoles()

    final IConnectionUserRoleMapper mapper = new MondrianOneToOneUserRoleListMapper();
    try {
      String[] roles = SecurityHelper.getInstance().runAsUser( "simplebob", new Callable<String[]>() {
        @Override
        public String[] call() throws Exception {
          return mapper.mapConnectionRoles( PentahoSessionHolder.getSession(), "SteelWheelsRoles" );
        }
      } );

      Assert.assertNotNull( roles );
      Assert.assertEquals( 2, roles.length );
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.