Package org.openbravo.model.ad.access

Examples of org.openbravo.model.ad.access.Role


      final Client client = (Client) bob;
      client.setName(newName);
      client.setDescription(newName);
      client.setSearchKey(newName);
    } else if (bob instanceof Role) {
      final Role role = (Role) bob;
      if (role.getName().indexOf(originalName) == -1) {
        role.setName(getNewName() + "_" + role.getName());
      } else {
        role.setName(replace(role.getName(), originalName));
      }
    } else if (bob instanceof User) {
      final User user = (User) bob;
      if (user.getUsername() == null) {
        return;
View Full Code Here


      // first take the passed role, if any
      // now check if the default role is active, if not another one needs
      // to be
      // selected.
      if (roleId != null) {
        final Role r = getOne(Role.class, "select r from " + Role.class.getName() + " r where "
            + " r." + Role.PROPERTY_ID + "='" + roleId + "'");
        setRole(r);
      } else if (getUser().getDefaultRole() != null && getUser().getDefaultRole().isActive()) {
        setRole(getUser().getDefaultRole());
      } else {
View Full Code Here

    // " CO";"Client+Organization"

    setUserContext("0");
    final List<Table> tables = OBDal.getInstance().createCriteria(Table.class).list();
    // SmallBazaar role --> CO
    final Role role = OBDal.getInstance().get(Role.class, "1000000");
    setUserContext("100");
    OBContext.getOBContext().setRole(role);
    final String userLevel = OBContext.getOBContext().getUserLevel();
    assertEquals("CO", userLevel.trim());
    boolean testDone = false;
View Full Code Here

TOP

Related Classes of org.openbravo.model.ad.access.Role

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.