Package org.openqreg.bean

Examples of org.openqreg.bean.Usergroup


    if (null != ucrUC) {
      return ucrUC.getGroupid();
    }

    // user does not have a ucrBean, get group
    Usergroup ug = (Usergroup) UsergroupFinderBase.findByPrimaryKey(con,
        new UsergroupKey(user.getGroupid()));

    /**
     * if ug is null (half created ucrUser) return null<br/>
     * or if ug is a ucrGroup, we would have found a ucr for this user on
     * this centre in the code above, as we didn't the user does not have
     * access to this centre, return null<br/>
     * (getUseucr != 0 handles errors in group table, where status only
     * should be 0 or 1, but might be null)
     */
    if (null == ug || !Integer.valueOf(0).equals(ug.getUseucr())) {
      return null;
    }

    /**
     * there is a ug, but it has use ucr = 1, this should already have been
     * returned something is wrong return null
     */
    if (Integer.valueOf(1).equals(ug.getUseucr())) {
      return null;
    }
    /**
     * nonUcrUser<br/>
     * must be on the same centre as the one we are looking at<br/>
View Full Code Here


    // get ucrBean for the user on this centreId
    UsercentrerelBean ucrUC = (UsercentrerelBean) UsercentrerelFinderBase
        .findByPrimaryKey(con, new UsercentrerelKey(user.getId(),
            centreId));

    Usergroup userGroup = (Usergroup) UsergroupFinderBase
        .findByPrimaryKey(new UsergroupKey(Dispatcher.getInstance()
            .getUser(user.getId()).getGroupid()));
    // ucrBean exists for this user on the centreId, user is ucrUser
    if (null != ucrUC) {
      return Integer.valueOf(1).equals(ucrUC.getStatus());
    } else if (userGroup.getUseucr().intValue() == 1) {
      // UsercentrerelBean does not exist,
      // The user has access to a subset of all centres, but not the
      // current centreId
      return false;
    }
View Full Code Here

    if (null != ucrUC) {
      return true;
    }

    // user does not have a ucrBean, get group
    Usergroup ug = (Usergroup) UsergroupFinderBase.findByPrimaryKey(con,
        new UsergroupKey(user.getGroupid()));

    /**
     * if ug is null (half created ucrUser) return null<br/>
     * or if ug is a ucrGroup, we would have found a ucr for this user on
     * this centre in the code above, as we didn't the user does not have
     * access to this centre, return null<br/>
     * (getUseucr != 0 handles errors in group table, where status only
     * should be 0 or 1, but might be null)
     */
    if (null == ug || !Integer.valueOf(0).equals(ug.getUseucr())) {
      return false;
    }

    /**
     * there is a ug, but it has use ucr = 1, this should already have been
     * returned something is wrong return null
     */
    if (Integer.valueOf(1).equals(ug.getUseucr())) {
      return false;
    }
    /**
     * nonUcrUser<br/>
     * must be on the same centre as the one we are looking at<br/>
View Full Code Here

    try {
      con = DbHandler.getConnection();
      Iterator<? extends Usergroup> groupsIterator = UsergroupFinderBase
          .findAll(con).iterator();
      Iterator<? extends Systemmessage> messageIterator;
      Usergroup usergroup;
      Systemmessage systemmessage;
      Set<Systemmessage> group;
      while (groupsIterator.hasNext()) {
        usergroup = groupsIterator.next();
        group = new HashSet<Systemmessage>();
        messageIterator = SystemmessageFinder.findByGroupid(con,
            usergroup.getId()).iterator();
        while (messageIterator.hasNext()) {
          systemmessage = messageIterator.next();
          group.add(systemmessage);
        }
        tmpSystemMessageTable.put(usergroup.getId(), group);
      }
      systemMessageTable = tmpSystemMessageTable;
    } catch (SQLException sqle) {
      logger.log(Level.FATAL, "Unable to populate system messages", sqle);
    } finally {
View Full Code Here

TOP

Related Classes of org.openqreg.bean.Usergroup

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.