Package org.openbravo.model.ad.access

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


        setRole(r);
      } else if (getUser().getDefaultRole() != null && getUser().getDefaultRole().isActive()) {
        setRole(getUser().getDefaultRole());
      } else {

        final UserRoles ur = getOne(UserRoles.class, "select ur from " + UserRoles.class.getName()
            + " ur where " + " ur." + UserRoles.PROPERTY_USERCONTACT + "." + User.PROPERTY_ID
            + "='" + u.getId() + "' and ur." + UserRoles.PROPERTY_ACTIVE + "='Y' and ur."
            + UserRoles.PROPERTY_ROLE + "." + Role.PROPERTY_ACTIVE + "='Y' order by ur."
            + UserRoles.PROPERTY_ROLE + "." + Role.PROPERTY_ID + " asc", false);
        if (ur == null) {
          throw new OBSecurityException(
              "Your user is not assigned to a Role and it is required to login into Openbravo. Ask the Security Administrator");
        }
        Hibernate.initialize(ur.getRole());
        setRole(ur.getRole());
      }

      Check.isNotNull(getRole(), "Role may not be null");

      if (orgId != null) {
View Full Code Here

TOP

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

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.