Package net.webpasswordsafe.common.model

Examples of net.webpasswordsafe.common.model.Group


            user.setActiveFlag(enabledCheckBox.getValue());
            user.updateAuthnPasswordValue(Utils.safeString(password1TextBox.getValue()));
            user.removeGroups();
            for (GroupData groupData : toGroupStore.getModels())
            {
                Group group = (Group)groupData.get(Constants.GROUP);
                user.addGroup(group);
            }
           
            final AsyncCallback<Void> callback = new AsyncCallback<Void>()
            {
View Full Code Here


    private void doAddGroup()
    {
        if (clientSessionUtil.isAuthorized(Function.ADD_GROUP))
        {
            displayGroupDialog(new Group());
        }
        else
        {
            MessageBox.alert(textMessages.error(), textMessages.notAuthorized(), null);
        }
View Full Code Here

        user.setDateCreated(now);
        userDAO.makePersistent(user);
        newUser.setId(user.getId());
       
        // assign user to everyone group
        Group everyoneGroup = getEveryoneGroup();
        everyoneGroup.addUser(user);
       
        // assign user to other groups
        for (Group newGroup : newUser.getGroups())
        {
            Group group = groupDAO.findById(newGroup.getId());
            group.addUser(user);
        }
        auditLogger.log(now, ServerSessionUtil.getUsername(), ServerSessionUtil.getIP(), "add user", userTarget(user), true, "");
    }
View Full Code Here

            }
           
            // remove old groups
            for (Group oldGroup : user.getGroups())
            {
                Group group = groupDAO.findById(oldGroup.getId());
                group.removeUser(user);
            }

            // assign everyone group
            Group everyoneGroup = getEveryoneGroup();
            everyoneGroup.addUser(user);
           
            // add new groups
            for (Group newGroup : updateUser.getGroups())
            {
                Group group = groupDAO.findById(newGroup.getId());
                group.addUser(user);
            }
           
            auditLogger.log(now, ServerSessionUtil.getUsername(), ServerSessionUtil.getIP(), action, userTarget(updateUser), true, "");
        }
        else
View Full Code Here

    }

    @Transactional(propagation=Propagation.REQUIRED)
    private void verifyEveryoneGroupExists()
    {
        Group everyoneGroup = getEveryoneGroup();
        if (null == everyoneGroup)
        {
            everyoneGroup = new Group(EVERYONE_GROUP_NAME);
            addGroupInternal(everyoneGroup);
        }
    }
View Full Code Here

        Date now = new Date();
        String action = "update group";
        User loggedInUser = getLoggedInUser();
        if (authorizer.isAuthorized(loggedInUser, Function.UPDATE_GROUP.name()))
        {
            Group group = groupDAO.findById(updateGroup.getId());
            String groupMessage = (updateGroup.getName().equals(group.getName())) ? "" : ("was: "+groupTarget(group));
            group.setName(updateGroup.getName());
            group.removeUsers();
            for (User user : updateGroup.getUsers())
            {
                User pUser = userDAO.findById(user.getId());
                group.addUser(pUser);
            }
            auditLogger.log(now, loggedInUser.getUsername(), ServerSessionUtil.getIP(), action, groupTarget(updateGroup), true, groupMessage);
        }
        else
        {
View Full Code Here

        Date now = new Date();
        String action = "delete group";
        User loggedInUser = getLoggedInUser();
        if (authorizer.isAuthorized(loggedInUser, Function.DELETE_GROUP.name()))
        {
            Group group = groupDAO.findById(updateGroup.getId());
            if (group != null)
            {
                // remove associated password permissions
                List<Password> passwords = passwordDAO.findPasswordsByPermissionSubject(group);
                for (Password password : passwords)
                {
                    password.removePermissionsBySubject(group);
                    passwordDAO.makePersistent(password);
                }
                // remove associated template details
                List<Template> templates = templateDAO.findTemplatesByDetailSubject(group);
                for (Template template : templates)
                {
                    template.removeDetailsBySubject(group);
                    templateDAO.makePersistent(template);
                }
                // remove associated users
                group.removeUsers();
                // actually remove group
                groupDAO.flush();
                groupDAO.makeTransient(group);
                auditLogger.log(now, loggedInUser.getUsername(), ServerSessionUtil.getIP(), action, groupTarget(group), true, "");
            }
View Full Code Here

    public List<Group> getGroups(boolean includeEveryoneGroup)
    {
        List<Group> groups = groupDAO.findAll();
        if (!includeEveryoneGroup)
        {
            groups.remove(new Group(EVERYONE_GROUP_NAME));
        }
        LOG.debug("found "+groups.size()+" groups");
        return groups;
    }
View Full Code Here

    @Override
    @Transactional(propagation=Propagation.REQUIRED, readOnly=true)
    public Group getGroupWithUsers(long groupId)
    {
        Group group = groupDAO.findById(groupId);
        // fetch users
        int numUsers = group.getUsers().size();
        LOG.debug(group.getName()+" has "+numUsers+" users");
        return group;
    }
View Full Code Here

    @Override
    @Transactional(propagation=Propagation.REQUIRED, readOnly=true)
    public boolean isGroupTaken(String groupName, long ignoreGroupId)
    {
        boolean isGroupTaken = false;
        Group group = groupDAO.findGroupByName(groupName);
        if (group != null)
        {
            if (group.getId() != ignoreGroupId)
            {
                isGroupTaken = true;
            }
        }
        return isGroupTaken;
View Full Code Here

TOP

Related Classes of net.webpasswordsafe.common.model.Group

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.