Examples of allowsRole()


Examples of org.apache.jetspeed.om.registry.SecurityEntry.allowsRole()

            // Minimize has no <allows-if .../>
            assertEquals("clerk role can NOT minimize", true, securityEntry.allowsRole("clerk", "minimize"));
            assertEquals("joe user can NOT minimize", true, securityEntry.allowsUser("joe", "minimize"));

            // Maximixe is not defined
            assertEquals("clerk role can NOT maximize", false, securityEntry.allowsRole("clerk", "maximize"));
            assertEquals("joe user can NOT maximize", false, securityEntry.allowsUser("joe", "maximize"));

            // Test the wide-open entry
            entryFound = false;
            for (Iterator securityIterator = securityEntries.iterator(); securityIterator.hasNext();)
View Full Code Here

Examples of org.apache.jetspeed.om.registry.SecurityEntry.allowsRole()

            {
                securityEntry = (SecurityEntry) securityIterator.next();
                if (securityEntry.getName().equals("wide_open") == true)
                {
                    entryFound = true;
                    assertEquals("any role is NOT allowed", false, securityEntry.allowsRole("customer", "do_any_thing"));
                    assertEquals("any user is allowed", true, securityEntry.allowsUser("joe_customer", "do_any_thing"));
                }
            }
            assertTrue("Found wide_open security entry", entryFound);
View Full Code Here

Examples of org.apache.jetspeed.om.registry.SecurityEntry.allowsRole()

        try
        {
            for( Iterator roles = JetspeedRoleManagement.getRoles(user.getUserName()); roles.hasNext();)
            {
                Role role = (Role) roles.next();
                if (securityEntry.allowsRole((String) role.getName(), action))
                    return true;
            }
        }
        catch (Exception e)
        {
View Full Code Here

Examples of org.apache.jetspeed.om.registry.SecurityEntry.allowsRole()

        entry.grantRoleAccess("view", "users");
        entry.grantRoleAccess("view", "hackers");
        entry.grantRoleAccess("edit", "managers");
        entry.grantRoleAccess("view", "managers");
       
        assertTrue("Role-assert: view/users", entry.allowsRole("users", "view"));
        assertTrue("Role-assert: view/hackers", entry.allowsRole("hackers", "view"));
        assertTrue("Role-assert: view/managers", entry.allowsRole("managers", "view"));
        assertTrue("Role-assert: edit/managers", entry.allowsRole("managers", "edit"));
       
        assertTrue("false Role-assert: edit/hackers", !entry.allowsRole("hackers", "edit"));
View Full Code Here

Examples of org.apache.jetspeed.om.registry.SecurityEntry.allowsRole()

        entry.grantRoleAccess("view", "hackers");
        entry.grantRoleAccess("edit", "managers");
        entry.grantRoleAccess("view", "managers");
       
        assertTrue("Role-assert: view/users", entry.allowsRole("users", "view"));
        assertTrue("Role-assert: view/hackers", entry.allowsRole("hackers", "view"));
        assertTrue("Role-assert: view/managers", entry.allowsRole("managers", "view"));
        assertTrue("Role-assert: edit/managers", entry.allowsRole("managers", "edit"));
       
        assertTrue("false Role-assert: edit/hackers", !entry.allowsRole("hackers", "edit"));
       
View Full Code Here

Examples of org.apache.jetspeed.om.registry.SecurityEntry.allowsRole()

        entry.grantRoleAccess("edit", "managers");
        entry.grantRoleAccess("view", "managers");
       
        assertTrue("Role-assert: view/users", entry.allowsRole("users", "view"));
        assertTrue("Role-assert: view/hackers", entry.allowsRole("hackers", "view"));
        assertTrue("Role-assert: view/managers", entry.allowsRole("managers", "view"));
        assertTrue("Role-assert: edit/managers", entry.allowsRole("managers", "edit"));
       
        assertTrue("false Role-assert: edit/hackers", !entry.allowsRole("hackers", "edit"));
       
        entry.revokeRoleAccess("view", "hackers");
View Full Code Here

Examples of org.apache.jetspeed.om.registry.SecurityEntry.allowsRole()

        entry.grantRoleAccess("view", "managers");
       
        assertTrue("Role-assert: view/users", entry.allowsRole("users", "view"));
        assertTrue("Role-assert: view/hackers", entry.allowsRole("hackers", "view"));
        assertTrue("Role-assert: view/managers", entry.allowsRole("managers", "view"));
        assertTrue("Role-assert: edit/managers", entry.allowsRole("managers", "edit"));
       
        assertTrue("false Role-assert: edit/hackers", !entry.allowsRole("hackers", "edit"));
       
        entry.revokeRoleAccess("view", "hackers");
View Full Code Here

Examples of org.apache.jetspeed.om.registry.SecurityEntry.allowsRole()

        assertTrue("Role-assert: view/users", entry.allowsRole("users", "view"));
        assertTrue("Role-assert: view/hackers", entry.allowsRole("hackers", "view"));
        assertTrue("Role-assert: view/managers", entry.allowsRole("managers", "view"));
        assertTrue("Role-assert: edit/managers", entry.allowsRole("managers", "edit"));
       
        assertTrue("false Role-assert: edit/hackers", !entry.allowsRole("hackers", "edit"));
       
        entry.revokeRoleAccess("view", "hackers");

        assertTrue("false Role-revoked-assert: view/hackers", !entry.allowsRole("hackers", "view"));
        assertTrue("Role-assert: view/users", entry.allowsRole("users", "view"));
View Full Code Here

Examples of org.apache.jetspeed.om.registry.SecurityEntry.allowsRole()

       
        assertTrue("false Role-assert: edit/hackers", !entry.allowsRole("hackers", "edit"));
       
        entry.revokeRoleAccess("view", "hackers");

        assertTrue("false Role-revoked-assert: view/hackers", !entry.allowsRole("hackers", "view"));
        assertTrue("Role-assert: view/users", entry.allowsRole("users", "view"));

        assertTrue("Role-specific: view/managers", entry.allowsSpecificRole("view", "managers"));
       
        System.out.println("Security Role Registry Cache Test done.");       
View Full Code Here

Examples of org.apache.jetspeed.om.registry.SecurityEntry.allowsRole()

        assertTrue("false Role-assert: edit/hackers", !entry.allowsRole("hackers", "edit"));
       
        entry.revokeRoleAccess("view", "hackers");

        assertTrue("false Role-revoked-assert: view/hackers", !entry.allowsRole("hackers", "view"));
        assertTrue("Role-assert: view/users", entry.allowsRole("users", "view"));

        assertTrue("Role-specific: view/managers", entry.allowsSpecificRole("view", "managers"));
       
        System.out.println("Security Role Registry Cache Test done.");       
    }
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.