Package org.jtalks.jcommune.model.entity

Examples of org.jtalks.jcommune.model.entity.JCUser.addGroup()


                    + "because too much time passed between registration and activation, or there is an error in link"
                    + ", might be possible the user searches for vulnerabilities in the forum.", uuid);
            throw new NotFoundException();
        } else if (!user.isEnabled()) {
            Group group = groupDao.getGroupByName(AdministrationGroup.USER.getName());
            user.addGroup(group);
            user.setEnabled(true);
            this.getDao().saveOrUpdate(user);
            LOGGER.info("User [{}] successfully activated", user.getUsername());
        } else {
            LOGGER.info("User [{}] tried to activate his account again, but that's impossible. Either he clicked the " +
View Full Code Here


    @Test
    public void addingValidUserToValidGroupShouldSucceed() {
        JCUser user = givenJCUserWithUsernameStoredInDb("test-user");
        Group group = PersistedObjectsFactory.group("test-group");
        user.addGroup(group);
        dao.saveOrUpdate(user);
        flushAndClearSession(session);

        Group selected = groupDao.get(group.getId());
        assertEquals(selected.getUsers().size(), 1);
View Full Code Here

        if (authInfo.containsKey("enabled")) {
            user.setEnabled(Boolean.parseBoolean(authInfo.get("enabled")));
        }
        if (user.isEnabled() && user.getGroups().isEmpty()) {
            Group group = groupDao.getGroupByName(AdministrationGroup.USER.getName());
            user.addGroup(group);
        }
        getDao().saveOrUpdate(user);
        return user;
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.