Examples of BaseSecurityAccess


Examples of org.apache.jetspeed.om.registry.base.BaseSecurityAccess

       
        Iterator accesses = sde.getSecurityAccessDbEntrys().iterator();
        while (accesses.hasNext())
        {
            SecurityAccessDbEntry sade = (SecurityAccessDbEntry)accesses.next();
            SecurityAccess access = new BaseSecurityAccess(sade.getId());
            access.setAction(sade.getAction());
                           
            Iterator allows = sade.getSecurityAllowDbEntrys().iterator();
            while (allows.hasNext())
            {
                SecurityAllowDbEntry sa = (SecurityAllowDbEntry)allows.next();
                if (sa.getAllowType().equals(ALLOW_OWNER))
                {
                    SecurityAllow allow = new BaseSecurityAllowOwner(sa.getId());                   
                    allow.setOwner(true);
                    access.getOwnerAllows().add(allow);
                }
                else if (sa.getAllowType().equals(ALLOW_BOTH))
                {
                    SecurityAllow allow = new BaseSecurityAllow(sa.getId());
                   
                    allow.setRole(sa.getAllowValue());
                    allow.setGroup(sa.getAllowGroup());
                    access.getAllows().add(allow);               
                }
                else if (sa.getAllowType().equals(ALLOW_ROLE))
                {
                    SecurityAllow allow = new BaseSecurityAllow(sa.getId());
                   
                    allow.setRole(sa.getAllowValue());
                    access.getAllows().add(allow);
                }
                else if (sa.getAllowType().equals(ALLOW_GROUP))
                {
                    SecurityAllow allow = new BaseSecurityAllow(sa.getId());
                   
                    allow.setGroup(sa.getAllowValue());
                    access.getAllows().add(allow);
                }
                else
                {
                    SecurityAllow allow = new BaseSecurityAllow(sa.getId());                   
                    allow.setUser(sa.getAllowValue());
                    access.getAllows().add(allow);
                }                   
            }
            se.getAccesses().add(access);
        }
        return se;
View Full Code Here

Examples of org.apache.jetspeed.om.registry.base.BaseSecurityAccess

                    rundata.getParameters().getInt("access_index", -1);
                if (accessIndex != -1)
                {
                    context.put("accessIndex", new Integer(accessIndex));
                    accessIndex--;
                    BaseSecurityAccess securityAccess =
                        (BaseSecurityAccess) securityEntry.getAccesses().get(
                            accessIndex);
                    context.put("securityAccess", securityAccess);
                }
            }
View Full Code Here

Examples of org.apache.jetspeed.om.registry.base.BaseSecurityAccess

                String action =
                    rundata.getParameters().getString("access_action");

                if (action != null && action.length() > 0)
                {
                    BaseSecurityAccess securityAccess =
                        new BaseSecurityAccess();
                    securityAccess.setAction(action);

                    addAllow(rundata, securityAccess);

                    Vector accesses = securityEntry.getAccesses();
                    accesses.add(securityAccess);
View Full Code Here

Examples of org.apache.jetspeed.om.registry.base.BaseSecurityAccess

                    rundata.getParameters().getString("access_action");

                if (accessIndex >= 0
                    && accessIndex < securityEntry.getAccesses().size())
                {
                    BaseSecurityAccess securityAccess =
                        (BaseSecurityAccess) securityEntry.getAccesses().get(
                            accessIndex);
                    securityAccess.setAction(action);

                    Registry.addEntry(Registry.SECURITY, securityEntry);
                    clearUserData(rundata);
                }
            }
View Full Code Here

Examples of org.apache.jetspeed.om.registry.base.BaseSecurityAccess

                accessIndex--;

                if (accessIndex >= 0
                    && accessIndex < securityEntry.getAccesses().size())
                {
                    BaseSecurityAccess securityAccess =
                        (BaseSecurityAccess) securityEntry.getAccesses().get(
                            accessIndex);
                    addAllow(rundata, securityAccess);
                    Registry.addEntry(Registry.SECURITY, securityEntry);
                    clearUserData(rundata);
View Full Code Here

Examples of org.apache.jetspeed.om.registry.base.BaseSecurityAccess

                accessIndex--;

                if (accessIndex >= 0
                    && accessIndex < securityEntry.getAccesses().size())
                {
                    BaseSecurityAccess securityAccess =
                        (BaseSecurityAccess) securityEntry.getAccesses().get(
                            accessIndex);

                    String allowType =
                        rundata.getParameters().getString(
                            "allow_type",
                            "allows");
                    int[] allowIndexes =
                        rundata.getParameters().getInts("allow_index");

                    if (allowIndexes != null && allowIndexes.length > 0)
                    {
                        for (int i = 0; i < allowIndexes.length; i++)
                        {
                            int allowIndex = allowIndexes[i];
                            allowIndex--;

                            if (allowIndex >= 0)
                            {
                                //TODO: more validation
                                if (allowType.equals("owner"))
                                {
                                    securityAccess.getOwnerAllows().remove(
                                        allowIndex);
                                }
                                else
                                {
                                    securityAccess.getAllows().remove(
                                        allowIndex);
                                }

                                Registry.addEntry(
                                    Registry.SECURITY,
View Full Code Here

Examples of org.apache.jetspeed.om.registry.base.BaseSecurityAccess

        assertEquals( "Getting number of accesses for all_users-view_anon", 1, accessVector.size());
        BaseSecurityAllow allowElement = new BaseSecurityAllow();
        allowElement.setRole("guest");
        Vector allowVector = new Vector();
        allowVector.addElement(allowElement);
        BaseSecurityAccess accessElement  = new BaseSecurityAccess();
        accessElement.setAction("view");
        accessElement.setAllows( allowVector );
        accessVector.addElement(accessElement);
        secEntry.setAccesses(accessVector);
        assertEquals( "Getting number of accesses for all_users-view_anon", 2, secEntry.getAccesses().size());
       
        // Verify users and their groups
View Full Code Here

Examples of org.apache.jetspeed.om.registry.base.BaseSecurityAccess

            allowElement.setRole(role);
            allowVector = new Vector();
            allowVector.addElement(allowElement);
        }
       
        BaseSecurityAccess accessElement  = new BaseSecurityAccess();
        accessElement.setAction(action);
        accessElement.setAllows( allowVector );
        Vector accessVector = new Vector();
        accessVector.addElement(accessElement);
       
        BaseSecurityEntry securityEntry = new BaseSecurityEntry();
        securityEntry.setName(name);
View Full Code Here

Examples of org.apache.jetspeed.om.registry.base.BaseSecurityAccess

        assertEquals( "Getting number of accesses for all_users-view_anon", 1, accessVector.size());
        BaseSecurityAllow allowElement = new BaseSecurityAllow();
        allowElement.setRole("guest");
        Vector allowVector = new Vector();
        allowVector.addElement(allowElement);
        BaseSecurityAccess accessElement  = new BaseSecurityAccess();
        accessElement.setAction("view");
        accessElement.setAllows( allowVector );
        accessVector.addElement(accessElement);
        secEntry.setAccesses(accessVector);
        assertEquals( "Getting number of accesses for all_users-view_anon", 2, secEntry.getAccesses().size());
       
        // Verify users and their groups
View Full Code Here

Examples of org.apache.jetspeed.om.registry.base.BaseSecurityAccess

            allowElement.setRole(role);
            allowVector = new Vector();
            allowVector.addElement(allowElement);
        }
       
        BaseSecurityAccess accessElement  = new BaseSecurityAccess();
        accessElement.setAction(action);
        accessElement.setAllows( allowVector );
        Vector accessVector = new Vector();
        accessVector.addElement(accessElement);
       
        BaseSecurityEntry securityEntry = new BaseSecurityEntry();
        securityEntry.setName(name);
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.