Package org.jabusuite.core.users

Examples of org.jabusuite.core.users.JbsUserGroup


            return 1;
        }

        public Object getValueAt(int column, int row) {
            if (row < this.getJbsObjects().size()) {
                JbsUserGroup group = (JbsUserGroup) this.getJbsObjects().get(row);
                switch (column) {
                    case 0:
                        String groupName = "";
                        if (group.getGroupName() != null) {
                            groupName = group.getGroupName();
                        }
                        return groupName;
                    default:
                        return "";
                }
View Full Code Here


    public JbsUserGroup findGroup(String groupName) {
        String query = "select a from JbsUserGroup as a where a.deleted=false AND a.groupName='" + groupName + "'";
        Query q = manager.createQuery(query);
        List groups = q.getResultList();
        if (groups.size() > 0) {
            JbsUserGroup group = (JbsUserGroup) groups.get(0);
            return group;
        } else {
            return null;
        }       
    }
View Full Code Here

    public void init() {
        logger.debug("Initializing groups...");
        if (this.findGroup(1) == null) {
            logger.debug("Adding group root.");
            JbsUserGroup rootGroup = new JbsUserGroup();
            rootGroup.setId(1);
            rootGroup.setGroupName("root");
            rootGroup.setGroupDescription("The group for the root-users.");
            this.createGroup(rootGroup);
        }
        if (this.findGroup(10) == null) {
            logger.debug("Adding group companyRoot");
            JbsUserGroup companyRootGroup = new JbsUserGroup();
            companyRootGroup.setId(10);
            companyRootGroup.setGroupName("companyRoot");
            companyRootGroup.setGroupDescription("The group for the company-root-users.");
            this.createGroup(companyRootGroup);
        }
        if (this.findGroup(100) == null) {
            logger.debug("Adding group users.");
            JbsUserGroup usersGroup = new JbsUserGroup();
            usersGroup.setId(100);
            usersGroup.setGroupName("users");
            usersGroup.setGroupDescription("The group for normal users.");
            this.createGroup(usersGroup);
        }
        if (this.findGroup(1001) == null) {
            logger.debug("Adding group webUsers.");
            JbsUserGroup usersGroup = new JbsUserGroup();
            usersGroup.setId(1001);
            usersGroup.setGroupName("webUsers");
            usersGroup.setGroupDescription("The group for users that were registeres via web and do not have any access to the software itself.");
            this.createGroup(usersGroup);
        }
    }
View Full Code Here

            query += " " + entityIdentifier + ".readGroup=TRUE and ("; //object readable by group -> check the groups of the user
            query += " " + entityIdentifier + ".group.id=" + this.getQueryLong(user.getMainGroup().getId());
            //Check the other groups of the user
            Iterator<JbsUserGroup> it = user.getGroups().iterator();
            while (it.hasNext()) {
                JbsUserGroup group = it.next();
                query += " or " + entityIdentifier + ".group.id=" + this.getQueryLong(group.getId());
            }
            query += ")";
            query += ")";
            query += ")";
        }
View Full Code Here

        //If no user exist create a root-user
        logger.debug("Initializing users...");
        if (this.findUser(1) == null) {
            logger.debug("Adding user root.");
            JbsUser rootUser = new JbsUser();
            JbsUserGroup rootGroup = manager.find(JbsUserGroup.class, new Long(1));
            rootUser.setId(1);
            rootUser.setMainGroup(rootGroup);
            rootUser.setUserName("root");
            rootUser.setPassword(StringUtils.encodeMD5("root"));
            createUser(rootUser);
        }
        if (this.findUser(2) == null) {
            logger.debug("Adding user test.");
            JbsUser rootUser = new JbsUser();
            JbsUserGroup rootGroup = manager.find(JbsUserGroup.class, new Long(1));
            rootUser.setId(2);
            rootUser.setMainGroup(rootGroup);
            rootUser.setUserName("test");
            rootUser.setPassword(StringUtils.encodeMD5("test"));
            createUser(rootUser);
View Full Code Here

    this.setPnEditJbsObject(new PnUserGroupEdit());
  }
 
  @Override
  public void createJbsBaseObject() {
    this.setJbsBaseObject(new JbsUserGroup());
  }
View Full Code Here

    }
   
    protected void importJobs(String fileName) {
        try {
            JbsUserGroupsRemote userGroups = (JbsUserGroupsRemote)ClientTools.getRemoteBean(JbsUserGroupsRemote.class);
            JbsUserGroup group = userGroups.findGroup("users");
           
            JobGroupsRemote jobGroups = (JobGroupsRemote)ClientTools.getRemoteBean(JobGroupsRemote.class);
            BufferedReader in = new BufferedReader(new FileReader(fileName));
            String zeile = null;
            while ((zeile = in.readLine()) != null) {
View Full Code Here

TOP

Related Classes of org.jabusuite.core.users.JbsUserGroup

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.