Package org.osgi.service.useradmin

Examples of org.osgi.service.useradmin.Group.addMember()


        User user1 = (User) m_userAdmin.createRole("user1", Role.USER);
       
        Group group1 = (Group) m_userAdmin.createRole("group1", Role.GROUP);
        assertNull(group1.getMembers());
       
        assertTrue(group1.addMember(user1));
       
        assertEquals(1, group1.getMembers().length);
    }

    /**
 
View Full Code Here


     */
    public void testGroupMembershipWithAnonymousUserOk() {
        Role user = m_userAdmin.createRole("user", Role.USER);

        Group group = (Group) m_userAdmin.createRole("group", Role.GROUP);
        group.addMember(user);

        Authorization auth = m_userAdmin.getAuthorization(null);
        assertTrue(auth.hasRole(Role.USER_ANYONE));
        assertFalse(auth.hasRole("group"));
    }
View Full Code Here

        User user2 = (User) m_userAdmin.createRole("user2", Role.USER);
        User user3 = (User) m_userAdmin.createRole("user3", Role.USER);
        User user4 = (User) m_userAdmin.createRole("user4", Role.USER);

        Group reqGroup = (Group) m_userAdmin.createRole("reqGroup", Role.GROUP);
        reqGroup.addMember(user1);
        reqGroup.addMember(user2);
       
        Group group = (Group) m_userAdmin.createRole("group", Role.GROUP);
        group.addRequiredMember(reqGroup);
        group.addMember(m_userAdmin.getRole(Role.USER_ANYONE));
View Full Code Here

        User user3 = (User) m_userAdmin.createRole("user3", Role.USER);
        User user4 = (User) m_userAdmin.createRole("user4", Role.USER);

        Group reqGroup = (Group) m_userAdmin.createRole("reqGroup", Role.GROUP);
        reqGroup.addMember(user1);
        reqGroup.addMember(user2);
       
        Group group = (Group) m_userAdmin.createRole("group", Role.GROUP);
        group.addRequiredMember(reqGroup);
        group.addMember(m_userAdmin.getRole(Role.USER_ANYONE));
View Full Code Here

        reqGroup.addMember(user1);
        reqGroup.addMember(user2);
       
        Group group = (Group) m_userAdmin.createRole("group", Role.GROUP);
        group.addRequiredMember(reqGroup);
        group.addMember(m_userAdmin.getRole(Role.USER_ANYONE));

        Authorization auth = m_userAdmin.getAuthorization(user1);
        assertTrue(auth.hasRole("group"));

        auth = m_userAdmin.getAuthorization(user2);
View Full Code Here

    public void testRemoveRoleRemovesItAsGroupMemberOk() {
        Role user1 = m_userAdmin.createRole("user1", Role.USER);
        Role user2 = m_userAdmin.createRole("user2", Role.USER);

        Group group1 = (Group) m_userAdmin.createRole("group1", Role.GROUP);
        group1.addMember(user1);

        Group group2 = (Group) m_userAdmin.createRole("group2", Role.GROUP);
        group2.addMember(user1);
        group2.addMember(user2);
       
View Full Code Here

        Group group1 = (Group) m_userAdmin.createRole("group1", Role.GROUP);
        group1.addMember(user1);

        Group group2 = (Group) m_userAdmin.createRole("group2", Role.GROUP);
        group2.addMember(user1);
        group2.addMember(user2);
       
        // Remove user...
        m_userAdmin.removeRole(user1.getName());
View Full Code Here

        Group group1 = (Group) m_userAdmin.createRole("group1", Role.GROUP);
        group1.addMember(user1);

        Group group2 = (Group) m_userAdmin.createRole("group2", Role.GROUP);
        group2.addMember(user1);
        group2.addMember(user2);
       
        // Remove user...
        m_userAdmin.removeRole(user1.getName());

        // Retrieve an up-to-date instance of the first group...
View Full Code Here

        children.addRequiredMember(m_anyone);
        adults.addRequiredMember(m_anyone);
        residents.addRequiredMember(m_anyone);

        // Table 107.1
        residents.addMember(elmer);
        residents.addMember(fudd);
        residents.addMember(marvin);
        residents.addMember(pepe);
       
        buddies.addMember(daffy);
View Full Code Here

        adults.addRequiredMember(m_anyone);
        residents.addRequiredMember(m_anyone);

        // Table 107.1
        residents.addMember(elmer);
        residents.addMember(fudd);
        residents.addMember(marvin);
        residents.addMember(pepe);
       
        buddies.addMember(daffy);
        buddies.addMember(foghorn);
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.