Package org.apache.lenya.ac

Examples of org.apache.lenya.ac.Group


        User user = getUser();
        user.removeFromAllGroups();

        List userGroups = (List) getParameter(USER_GROUPS);
        for (Iterator i = userGroups.iterator(); i.hasNext();) {
            Group group = (Group) i.next();
            group.add(user);
        }
        user.save();
    }
View Full Code Here


                String groupId = getParameterAsString(OTHER_GROUP);
                if (groupId != null) {
                    if (getLogger().isDebugEnabled()) {
                        getLogger().debug("add group [" + groupId + "]");
                    }
                    Group group = getGroupManager().getGroup(groupId);
                    userGroups.add(group);
                    otherGroups.remove(group);
                }
            }

            if (remove != null) {
                String groupId = getParameterAsString(USER_GROUP);
                if (groupId != null) {
                    if (getLogger().isDebugEnabled()) {
                        getLogger().debug("remove group [" + groupId + "]");
                    }
                    Group group = getGroupManager().getGroup(groupId);
                    otherGroups.add(group);
                    userGroups.remove(group);
                }
            }
View Full Code Here

     */
    protected void doExecute() throws Exception {
        super.doExecute();

        String groupId = getParameterAsString(GroupProfile.ID);
        Group group = getGroupManager().getGroup(groupId);
        if (group == null) {
            throw new RuntimeException("Group [" + groupId + "] not found.");
        }
       
        getGroupManager().remove(group);
        group.delete();
    }
View Full Code Here

    /**
     * @see org.apache.lenya.ac.GroupManager#add(java.lang.String)
     */
    public Group add(String id) throws AccessControlException {
        Group group = new FileGroup(this, getLogger(), id);
        super.add(group);
        return group;
    }
View Full Code Here

                throw new ConfigurationException("configuration failed: ", e);
            }

            for (int i = 0; i < groups.length; i++) {
                String groupId = groups[i].getValue();
                Group group = manager.getGroup(groupId);

                if (group == null) {
                    throw new ConfigurationException("Couldn't find Group for group name ["
                            + groupId + "]");
                }

                if (!group.contains(this)) {
                    group.add(this);
                }

            }
        } else {
            // strange, it should have groups
View Full Code Here

    protected void doExecute() throws Exception {
        super.doExecute();

        Set usersToSave = new HashSet();
       
        final Group group = getGroup();
        Groupable[] members = group.getMembers();
        for (int i = 0; i < members.length; i++) {
            if (members[i] instanceof User) {
                usersToSave.add(members[i]);
            }
        }
       
        group.removeAllMembers();

        List groupUsers = (List) getParameter(GROUP_USERS);
        for (Iterator i = groupUsers.iterator(); i.hasNext();) {
            User user = (User) i.next();
            group.add(user);
            usersToSave.add(user);
        }
       
        for (Iterator i = usersToSave.iterator(); i.hasNext(); ) {
            ((User) i.next()).save();
View Full Code Here

    }
   
    protected Group getGroup() {
        String groupId = getParameterAsString(GroupProfile.ID);
        Group group = getGroupManager().getGroup(groupId);
        if (group == null) {
            throw new RuntimeException("Group [" + groupId + "] not found.");
        }
        return group;
    }
View Full Code Here

     */
    void validate() throws UsecaseException {

        String groupId = getParameterAsString(GroupProfile.ID);

        Group existingGroup = getGroupManager().getGroup(groupId);

        if (existingGroup != null) {
            addErrorMessage("This group already exists.");
        }

View Full Code Here

        String id = getParameterAsString(GroupProfile.ID);
        String name = getParameterAsString(GroupProfile.NAME);
        String description = getParameterAsString(GroupProfile.DESCRIPTION);

        Group group = getGroupManager().add(id);
        group.setName(name);
        group.setDescription(description);
       
        group.save();
       
        setExitParameter(GroupProfile.ID, id);
    }
View Full Code Here

        IPRange ipRange = getIpRange();
        ipRange.removeFromAllGroups();
       
        List ipRangeGroups = (List) getParameter(IP_RANGE_GROUPS);
        for (Iterator i = ipRangeGroups.iterator(); i.hasNext(); ) {
            Group group = (Group) i.next();
            group.add(ipRange);
        }
        ipRange.save();
    }
View Full Code Here

TOP

Related Classes of org.apache.lenya.ac.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.