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

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


    userCache.put( jackrabbitUser.getID(), pentahoUser );
    return pentahoUser;
  }

  private IPentahoRole convertToPentahoRole( Group jackrabbitGroup ) throws RepositoryException {
    IPentahoRole role = null;
    Value[] propertyValues = null;

    String description = null;
    try {
      propertyValues = jackrabbitGroup.getProperty( "description" ); //$NON-NLS-1$
View Full Code Here


      UserManager userMgr = getUserManager( theTenant, session );
      pPrincipalName = ( (SessionImpl) session ).getJCRName( P_PRINCIPAL_NAME );
      Iterator<Authorizable> it = userMgr.findAuthorizables( pPrincipalName, null, UserManager.SEARCH_TYPE_GROUP );
      while ( it.hasNext() ) {
        Group group = (Group) it.next();
        IPentahoRole pentahoRole = convertToPentahoRole( group );
        // Exclude the system role from the list of roles to be returned back
        if ( !extraRoles.contains( pentahoRole.getName() ) ) {
          if ( includeSubtenants ) {
            roles.add( pentahoRole );
          } else {
            if ( pentahoRole.getTenant() != null && pentahoRole.getTenant().equals( theTenant ) ) {
              roles.add( pentahoRole );
            }
          }
        }
      }
View Full Code Here

    if ( ( jackrabbitUser != null )
        && TenantUtils.isAccessibleTenant( theTenant == null ? tenantedUserNameUtils.getTenant( jackrabbitUser.getID() )
            : theTenant ) ) {
      Iterator<Group> groups = jackrabbitUser.memberOf();
      while ( groups.hasNext() ) {
        IPentahoRole role = convertToPentahoRole( groups.next() );
        // Exclude the extra role from the list of roles to be returned back
        if ( !extraRoles.contains( role.getName() ) ) {
          roles.add( role );
        }
      }
    }
    return roles;
View Full Code Here

    public IPentahoRole createRole( ITenant tenant, String roleName, String description, String[] memberUserNames )
      throws AlreadyExistsException, UncategorizedUserRoleDaoException {
      if ( tenant == null ) {
        tenant = getDefaultTenant();
      }
      IPentahoRole role = getRole( tenant, roleName );
      if ( role == null ) {
        role = new PentahoRole( tenant, roleName, description );
        roles.add( role );
        setRoleMembers( tenant, roleName, memberUserNames );
      } else {
View Full Code Here

      throws UncategorizedUserRoleDaoException {
      if ( tenant == null ) {
        tenant = getDefaultTenant();
      }
      Set<IPentahoUser> members = null;
      IPentahoRole pentahoRole = getRole( tenant, roleName );
      if ( pentahoRole != null ) {
        members = roleMembersMap.get( pentahoRole );
      }
      return members == null ? new ArrayList<IPentahoUser>() : new ArrayList<IPentahoUser>( members );
    }
View Full Code Here

      UncategorizedUserRoleDaoException {
      if ( tenant == null ) {
        tenant = getDefaultTenant();
      }

      IPentahoRole role = getRole( tenant, roleName );
      if ( role != null ) {
        role.setDescription( description );
      } else {
        throw new NotFoundException( "" );
      }
    }
View Full Code Here

      if ( tenant == null ) {
        tenant = getDefaultTenant();
      }

      IPentahoRole role = getRole( tenant, roleName );
      if ( role == null ) {
        throw new NotFoundException( "" );
      }

      for ( Set<IPentahoRole> assignedRoles : userRolesMap.values() ) {
View Full Code Here

      Set<IPentahoRole> assignedRoles = new HashSet<IPentahoRole>();
      if ( roleNames == null ) {
        roleNames = new String[0];
      }
      for ( String roleName : roleNames ) {
        IPentahoRole role = getRole( tenant, roleName );
        if ( role != null ) {
          assignedRoles.add( role );
        }
      }
View Full Code Here

      }
    }

    @Override
    public void deleteRole( IPentahoRole role ) throws NotFoundException, UncategorizedUserRoleDaoException {
      IPentahoRole realRole = getRole( role.getTenant(), role.getName() );
      if ( realRole != null ) {
        roles.remove( realRole );
        roleMembersMap.remove( realRole );
        for ( Set<IPentahoRole> assignedRoles : userRolesMap.values() ) {
          assignedRoles.remove( realRole );
View Full Code Here

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

    IPentahoRole role = getRole( tenant, roleName );
    return Collections.list( Collections.enumeration( roleMembers.get( role ) ) );
  }
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.