Examples of allowsUser()


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

            // test allows
            assertEquals("clerk role can view", true, securityEntry.allowsRole("clerk", "view"));
            assertEquals("manager role can view", true, securityEntry.allowsRole("manager", "view"));
            assertEquals("anonymous role can NOT view", false, securityEntry.allowsRole("anonymous", "view"));
            assertEquals("fred user can view", true, securityEntry.allowsUser("fred", "view"));
            assertEquals("joe user can view", true, securityEntry.allowsUser("joe", "view"));
            assertEquals("anonymous user can NOT view", false, securityEntry.allowsUser("anonymous", "view"));

            // Customize has <allow-id user="*"/>
            assertEquals("clerk role can NOT customize", false, securityEntry.allowsRole("clerk", "customize"));
View Full Code Here

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

            // test allows
            assertEquals("clerk role can view", true, securityEntry.allowsRole("clerk", "view"));
            assertEquals("manager role can view", true, securityEntry.allowsRole("manager", "view"));
            assertEquals("anonymous role can NOT view", false, securityEntry.allowsRole("anonymous", "view"));
            assertEquals("fred user can view", true, securityEntry.allowsUser("fred", "view"));
            assertEquals("joe user can view", true, securityEntry.allowsUser("joe", "view"));
            assertEquals("anonymous user can NOT view", false, securityEntry.allowsUser("anonymous", "view"));

            // Customize has <allow-id user="*"/>
            assertEquals("clerk role can NOT customize", false, securityEntry.allowsRole("clerk", "customize"));
            assertEquals("joe user can customize", true, securityEntry.allowsUser("joe", "customize"));
View Full Code Here

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

            assertEquals("clerk role can view", true, securityEntry.allowsRole("clerk", "view"));
            assertEquals("manager role can view", true, securityEntry.allowsRole("manager", "view"));
            assertEquals("anonymous role can NOT view", false, securityEntry.allowsRole("anonymous", "view"));
            assertEquals("fred user can view", true, securityEntry.allowsUser("fred", "view"));
            assertEquals("joe user can view", true, securityEntry.allowsUser("joe", "view"));
            assertEquals("anonymous user can NOT view", false, securityEntry.allowsUser("anonymous", "view"));

            // Customize has <allow-id user="*"/>
            assertEquals("clerk role can NOT customize", false, securityEntry.allowsRole("clerk", "customize"));
            assertEquals("joe user can customize", true, securityEntry.allowsUser("joe", "customize"));

View Full Code Here

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

            assertEquals("joe user can view", true, securityEntry.allowsUser("joe", "view"));
            assertEquals("anonymous user can NOT view", false, securityEntry.allowsUser("anonymous", "view"));

            // Customize has <allow-id user="*"/>
            assertEquals("clerk role can NOT customize", false, securityEntry.allowsRole("clerk", "customize"));
            assertEquals("joe user can customize", true, securityEntry.allowsUser("joe", "customize"));

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

View Full Code Here

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

            assertEquals("clerk role can NOT customize", false, securityEntry.allowsRole("clerk", "customize"));
            assertEquals("joe user can customize", true, securityEntry.allowsUser("joe", "customize"));

            // 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"));
View Full Code Here

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

            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.allowsUser()

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

            // Test the owner-only entry
View Full Code Here

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

                securityEntry = (SecurityEntry) securityIterator.next();
                if (securityEntry.getName().equals("owner_only") == true)
                {
                    entryFound = true;
                    assertEquals("User joe_customer is not allowed", false,
                                 securityEntry.allowsUser("joe_customer", "do_any_thing"));
                    assertEquals("User joe_customer is not allowed", false,
                                 securityEntry.allowsUser("joe_customer", "do_any_thing", "joe_owner"));
                    assertEquals("User joe_owner is allowed", true,
                                 securityEntry.allowsUser("joe_owner", "do_any_thing", "joe_owner"));
                }
View Full Code Here

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

                {
                    entryFound = true;
                    assertEquals("User joe_customer is not allowed", false,
                                 securityEntry.allowsUser("joe_customer", "do_any_thing"));
                    assertEquals("User joe_customer is not allowed", false,
                                 securityEntry.allowsUser("joe_customer", "do_any_thing", "joe_owner"));
                    assertEquals("User joe_owner is allowed", true,
                                 securityEntry.allowsUser("joe_owner", "do_any_thing", "joe_owner"));
                }
            }
            assertTrue("Found owner_only security entry", entryFound);
View Full Code Here

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

                    assertEquals("User joe_customer is not allowed", false,
                                 securityEntry.allowsUser("joe_customer", "do_any_thing"));
                    assertEquals("User joe_customer is not allowed", false,
                                 securityEntry.allowsUser("joe_customer", "do_any_thing", "joe_owner"));
                    assertEquals("User joe_owner is allowed", true,
                                 securityEntry.allowsUser("joe_owner", "do_any_thing", "joe_owner"));
                }
            }
            assertTrue("Found owner_only security entry", entryFound);
        }
    }
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.