Package org.apache.turbine.util.security

Examples of org.apache.turbine.util.security.AccessControlList


        if (!TurbineSecurity.isAnonymousUser(user)
            && user.hasLoggedIn())
        {
            log.debug("Fetching ACL for " + user.getName());
            AccessControlList acl = (AccessControlList)
                    data.getSession().getAttribute(
                            AccessControlList.SESSION_KEY);
            if (acl == null)
            {
                log.debug("No ACL found in Session, building fresh ACL");
View Full Code Here


        }

        Map roles = new HashMap();
        Map permissions = new HashMap();

        AccessControlList aclTest =
          TurbineSecurity.getService().getAclInstance(roles, permissions);

        if(aclTest == null)
        {
          fail("Security Service failed to deliver a " + aclClass.getName()
View Full Code Here

        assertNotNull(global);

        Role app = ss.getRoleByName("User");
        assertNotNull(app);

        AccessControlList acl = ss.getACL(admin);
        assertFalse(acl.hasRole(app, global));

        ss.grant(admin, global, app);

        AccessControlList acl2 = ss.getACL(admin);
        assertTrue(acl2.hasRole(app, global));

        // Get existing ACL modified?
        assertFalse(acl.hasRole(app, global));

        try
View Full Code Here

        assertNotNull(global);

        Role app = ss.getRoleByName("User");
        assertNotNull(app);

        AccessControlList acl = ss.getACL(admin);
        assertTrue(acl.hasRole(app, global));

        ss.revoke(admin, global, app);

        AccessControlList acl2 = ss.getACL(admin);
        assertFalse(acl2.hasRole(app, global));

        // Get existing ACL modified?
        assertTrue(acl.hasRole(app, global));

         try
View Full Code Here

        assertNotNull(admin);

        Group turbine = ss.getGroupByName("Turbine");
        assertNotNull(turbine);

        AccessControlList acl = ss.getACL(admin);
        assertEquals(1, acl.getRoles(turbine).size());

        ss.revokeAll(admin);

        AccessControlList acl2 = ss.getACL(admin);
        assertEquals(0, acl2.getRoles(turbine).size());
    }
View Full Code Here

        SecurityService ss = TurbineSecurity.getService();

        User admin = ss.getUser("admin");
        assertNotNull(admin);

        AccessControlList acl = ss.getACL(admin);
        assertNotNull(acl);

        assertFalse(acl.hasRole("Admin", "global"));
        assertTrue(acl.hasRole("Admin", "Turbine"));
        assertFalse(acl.hasRole("User", "global"));
        assertFalse(acl.hasRole("User", "Turbine"));

        assertFalse(acl.hasPermission("Admin", "global"));
        assertTrue(acl.hasPermission("Admin", "Turbine"));
        assertFalse(acl.hasPermission("Login", "global"));
        assertFalse(acl.hasPermission("Login", "Turbine"));
        assertFalse(acl.hasPermission("Application", "global"));
        assertFalse(acl.hasPermission("Application", "Turbine"));
    }
View Full Code Here

        SecurityService ss = TurbineSecurity.getService();

        User admin = ss.getUser("user");
        assertNotNull(admin);

        AccessControlList acl = ss.getACL(admin);
        assertNotNull(acl);

        assertFalse(acl.hasRole("Admin", "global"));
        assertFalse(acl.hasRole("Admin", "Turbine"));
        assertFalse(acl.hasRole("User", "global"));
        assertTrue(acl.hasRole("User", "Turbine"));

        assertFalse(acl.hasPermission("Admin", "global"));
        assertFalse(acl.hasPermission("Admin", "Turbine"));
        assertFalse(acl.hasPermission("Login", "global"));
        assertTrue(acl.hasPermission("Login", "Turbine"));
        assertFalse(acl.hasPermission("Application", "global"));
        assertTrue(acl.hasPermission("Application", "Turbine"));
    }
View Full Code Here

        SecurityService ss = TurbineSecurity.getService();

        User user = ss.getUser("user");
        assertNotNull(user);

        AccessControlList acl = ss.getACL(user);
        assertNotNull(acl);

        Group turbine = ss.getGroupByName("Turbine");
        assertNotNull(turbine);

        assertEquals(0, acl.getRoles().size());
        assertEquals(1, acl.getRoles(turbine).size());
        assertEquals(0, acl.getPermissions().size());
        assertEquals(2, acl.getPermissions(turbine).size());
    }
View Full Code Here

    public AccessControlList getAclInstance(Map roles, Map permissions)
            throws UnknownEntityException
    {
        Object[] objects = {roles, permissions};
        String[] signatures = {Map.class.getName(), Map.class.getName()};
        AccessControlList accessControlList;

        try
        {
            accessControlList =
                    (AccessControlList) aclFactoryService.getInstance(aclClass.getName(),
View Full Code Here

                    groupPermissions.add(rolePermissions);
                }
                // put the Set into permissions(group)
                permissions.put(group, groupPermissions);
            }
            return new AccessControlList(roles, permissions);
        }
        catch(Exception e)
        {
            throw new DataBackendException("Failed to build ACL for user '" +
                                    user.getUserName() + "'" , e);
View Full Code Here

TOP

Related Classes of org.apache.turbine.util.security.AccessControlList

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.