Package org.pentaho.platform.security.policy.rolebased

Examples of org.pentaho.platform.security.policy.rolebased.RoleBindingStruct


  @Produces ( { APPLICATION_XML, APPLICATION_JSON } )
  @Facet ( name = "Unsupported" )
  public SystemRolesMap getRoleBindingStruct( @QueryParam ( "locale" ) String locale ) {
    if ( canAdminister() ) {
      try {
        RoleBindingStruct roleBindingStruct = roleBindingDao.getRoleBindingStruct( locale );
        SystemRolesMap systemRolesMap = new SystemRolesMap();
        for ( Map.Entry<String, String> localalizeNameEntry : roleBindingStruct.logicalRoleNameMap.entrySet() ) {
          systemRolesMap.getLocalizedRoleNames().add(
              new LocalizedLogicalRoleName( localalizeNameEntry.getKey(), localalizeNameEntry.getValue() ) );
        }
View Full Code Here


        tenantManager.createTenant( systemTenant, TENANT_ID_ACME, tenantAdminRoleName, tenantAuthenticatedRoleName,
            ANONYMOUS_ROLE_NAME );
    userRoleDao.createUser( tenantAcme, USERNAME_ADMIN, PASSWORD, "", new String[] { tenantAdminRoleName } );

    login( USERNAME_ADMIN, tenantAcme, new String[] { tenantAdminRoleName, tenantAuthenticatedRoleName } );
    RoleBindingStruct struct = roleBindingDao.getRoleBindingStruct( Locale.getDefault().toString() );
    assertNotNull( struct );
    assertNotNull( struct.bindingMap );
    assertEquals( 3, struct.bindingMap.size() );
    assertEquals( Arrays.asList( new String[] { RepositoryReadAction.NAME, RepositoryCreateAction.NAME,
      SchedulerAction.NAME, AdministerSecurityAction.NAME, PublishAction.NAME } ), struct.bindingMap
View Full Code Here

    final LinkedList<String> roles = new LinkedList<String>();
    roles.add( RepositoryCreateAction.NAME );
    bindingMap.put( "admin", roles );
    final HashSet<String> immutableRoles = new HashSet<String>();
    immutableRoles.add( "admin" );
    final RoleBindingStruct roleBindingStruct = new RoleBindingStruct( logicalRoleNameMap, bindingMap, immutableRoles );

    RoleBindingStructAdapter adapter = new RoleBindingStructAdapter();
    final JaxbSafeRoleBindingStruct marshaled = adapter.marshal( roleBindingStruct );
    assertEquals( roleBindingStruct.bindingMap.size(), marshaled.bindingMapEntries.size() );
    assertEquals( roleBindingStruct.logicalRoleNameMap.size(), marshaled.logicalRoleNameMapEntries.size() );
    assertEquals( roleBindingStruct.immutableRoles.size(), marshaled.immutableRoles.size() );

    final RoleBindingStruct unmarshaled = adapter.unmarshal( marshaled );

    assertEquals( roleBindingStruct.bindingMap, unmarshaled.bindingMap );
    assertEquals( roleBindingStruct.logicalRoleNameMap, unmarshaled.logicalRoleNameMap );
    assertEquals( roleBindingStruct.immutableRoles, unmarshaled.immutableRoles );
  }
View Full Code Here

        }
      }
      if ( v.immutableRoles != null ) {
        immutableRoles.addAll( v.immutableRoles );
      }
      return new RoleBindingStruct( logicalRoleNameMap, bindingMap, immutableRoles );
    } catch ( Exception e ) {
      logger
          .error(
              Messages
                  .getInstance()
View Full Code Here

TOP

Related Classes of org.pentaho.platform.security.policy.rolebased.RoleBindingStruct

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.