Package org.apache.lenya.ac

Examples of org.apache.lenya.ac.Group


                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

     */
    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);

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

       
        this.ipRange.removeFromAllGroups();
       
        List ipRangeGroups = (List) getParameter(IP_RANGE_GROUPS);
        for (Iterator i = ipRangeGroups.iterator(); i.hasNext(); ) {
            Group group = (Group) i.next();
            group.add(this.ipRange);
        }
        ipRange.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);
                    ipRangeGroups.add(group);
                    otherGroups.remove(group);
                }
            }

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

    final public void testGetGroups() throws AccessControlException {
        FileUser user = createAndSaveUser("alice", "Alice Wonderland", "alice@wonderland.org",
                "secret");

        for (Iterator i = getGroups().values().iterator(); i.hasNext();) {
            Group group = (Group) i.next();
            assertTrue(group.contains(user));
        }
    }
View Full Code Here

    /**
     * Tests the removeAllMembers() method.
     */
    public void testRemoveAllMembers() {
        Group group = getGroup();
        Groupable members[] = group.getMembers();
        group.removeAllMembers();
        for (int i = 0; i < members.length; i++) {
            assertFalse(group.contains(members[i]));
        }
    }
View Full Code Here

                "secret");

        editorRole.save();
        adminRole.save();

        Group editorGroup = new FileGroup(configDir, editorGroupId);

        //    editorGroup.addRole(editorRole);
        editorGroup.add(user);

        FileGroup adminGroup = new FileGroup(configDir, adminGroupId);

        //    adminGroup.addRole(editorRole);
        //    adminGroup.addRole(adminRole);
        editorGroup.save();
        adminGroup.save();
        adminGroup.add(user);
        user.save();

        FileGroupManager groupManager = null;
        UserType[] userTypes = { FileAccreditableManager.getDefaultUserType() };
        FileUserManager userManager = FileUserManager.instance(configDir, userTypes,
                getLogger());
        assertNotNull(userManager);

        groupManager = FileGroupManager.instance(configDir, getLogger());
        assertNotNull(groupManager);

        Group fetchedGroup = groupManager.getGroup(editorGroupId);
        assertTrue(editorGroup.equals(fetchedGroup));

        fetchedGroup = groupManager.getGroup(adminGroupId);
        assertTrue(adminGroup.equals(fetchedGroup));
    }
View Full Code Here

                                + this.configurationDirectory + "]", 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

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.